You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit-message Cancel silently no-ops when clicked before the generation process spawns #10855
Cancel on commit-message generation silently no-ops if clicked before the generation process spawns. This affects the ordinary single-repo path, not just folder workspaces.
Mechanism
The cancel token is installed into the lane map only after the child process is spawned:
Everything before that point is awaited work — runtime git target resolution, settings resolution, the staged-context read, env prep. On a large staged diff, a cold SSH connection, or a slow provider-settings read, that window is comfortably long enough to click Cancel in.
The ?. means a miss is indistinguishable from success. Every caller is fire-and-forget, so nothing surfaces the miss: the button appears to work, the spinner keeps going, and the draft lands anyway.
Repro
Stage a large diff (enough that context assembly takes a beat), ideally over SSH.
Click Generate commit message.
Click Cancel immediately — before the model starts streaming.
The generation completes and overwrites the commit message box.
Expected
A Cancel issued at any point after Generate should stop the generation, including before spawn.
Suggested direction
Either install the cancel token before the pre-spawn awaits (so it exists for the whole lifetime of the request), or record a pending-cancel flag on the lane that the spawn step consumes and aborts on. The second avoids a token that can't yet do anything; the first is simpler if the token can be made a no-op-until-armed.
Worth covering in tests: cancel before spawn, cancel during spawn, and cancel after spawn all reaching the same terminal state.
Provenance
Found while reviewing #10819 (folder-workspace git routing). Confirmed pre-existing and out of that PR's scope — git diff origin/main..HEAD is empty for this file, and origin/main has the identical post-spawn cancelTokensByLane.set at the same line. Filing separately because the fix touches shared generation lifecycle rather than folder-workspace routing.
Activity
fix(git): honor commit message cancel before the agent spawns (stably…