eca__git tool calls in one assistant message run concurrently and race on index.lock
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start by verifying the reported dispatch behavior in src/eca/features/chat/tool_calls.clj, especially the :add-future handling and the post-reduce join. Then trace how eca__git calls are dispatched and whether they share a repository context; the issue also notes that eca__shell_command can run Git. Done means concurrent Git writes to the same repository are serialized or fail explicitly, with tests covering the race and confirming ordinary tool calls can still run concurrently.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Multiple eca__git calls in a single assistant message execute concurrently, so they race on .git/index.lock and the ref store. The failure is usually silent: the second command operates on the tree as it was before the first, and both report success.
on-tools-called! in src/eca/features/chat/tool_calls.clj reduces over the turn's tool calls and starts each approved one as a future — the :add-future action forces the delay — then moves to the next without waiting. The futures are joined in a doseq only after the reduce has started them all. So a turn containing two git calls runs two git processes against the same repo simultaneously.
That's correct and desirable for most tools. Git is the exception: its writes take exclusive locks, so concurrent invocations in one repo are never safe, even when they look independent.
To Reproduce
Get the model to emit two eca__git calls in one message, e.g.
git add -Agit commit --amend -F - <<'EOF' ... EOF
Observed outcomes:
fatal: Unable to create '.../index.lock': File exists— visible and recoverable- the amend silently doesn't happen, the previous commit stays in place, and both calls report success
git commit + git push has the same shape, and there the silent case pushes the pre-commit tree while reporting a normal ref update.
Expected behavior
Git writes against the same repo are serialised, or the second fails loudly instead of racing.
Doctor
ECA server: 0.160.2
Client: emacs GNU Emacs 30.2 (aarch64-apple-darwin25.6.0)
OS: Mac OS X 26.7
Java: 25.0.4
Additional context
Prompt-level rules are unreliable here. The system prompt encourages batching independent tool calls, and add + commit read as independent verbs while being one logical operation, so the judgement goes wrong exactly where it matters.
Possible approaches, increasing in precision:
- Serialise all
eca__gitcalls behind a per-repo lock. Git commands are short and there's little to gain from running them concurrently. - Serialise writes only. The tool's
operationenum nearly classifies this already (status,diff,log,pr_vieware reads), but it's LLM-supplied, so parsing the command is safer —shell-parser/approval-keysalready does command parsing for approvals. - Reject a second concurrent git write with an explicit error. Noisier, but it teaches the model to split the calls rather than hiding the mistake.
eca__shell_command can also run git, so it has the same exposure, though detecting it there is harder.
One caveat: the dispatch behaviour above is from reading tool_calls.clj, not from instrumenting a build. The delay/future/:add-future chain and the post-reduce join look unambiguous, but worth confirming before acting on it.
- Lenguaje dominante
- Clojure
- Estrellas
- 1k
- Forks
- 82
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 16
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de editor-code-assistant/eca
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
editor-code-assistant/eca#661 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
editor-code-assistant/eca#657 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
editor-code-assistant/eca#652 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
editor-code-assistant/eca#648 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
editor-code-assistant/eca#644 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de editor-code-assistant/eca
Issues similares
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
module:cql
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
.Needs Triage Priority:P3 Type:Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
metabase/metabase#84843 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NoahTheDuke/splint#57 · 1 comentario ·
-
category:runtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jank-lang/jank#1110 · 2 comentarios ·
Los mantenedores suelen responder en 1 día