eca__git tool calls in one assistant message run concurrently and race on index.lock
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Clojure
- Stelle
- 1k
- Fork
- 82
- Merge medio
- 3g 39m
- PR unite (30g)
- 15
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di editor-code-assistant/eca
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
editor-code-assistant/eca#655 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
editor-code-assistant/eca#652 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
editor-code-assistant/eca#648 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
editor-code-assistant/eca#644 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Add the ability to see what changed in the system promptForse già presa @zikajk l’ha presa 9 giorni fa. Apertaenhancement
editor-code-assistant/eca#642 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di editor-code-assistant/eca
Issue simili
-
Usage analytics `v_tables` ignores table metadata set by users (`metabase_table_user_settings`)Aperta.Needs Triage .Team/Graphy Priority:P3 Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
metabase/metabase#84762 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NoahTheDuke/splint#57 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
IOP MCP
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
calcit-lang/calcit#2133 ·
I maintainer di solito rispondono entro 1 giorno