Summary
The status-bar git slot (line 2, branch@sha[*]) loses the branch name while a turn is in flight and paints only @<short-sha>. Idle / post-turn it is the full branch@sha again.
Observed
- Idle / after
done: git slot is main@abc1234 (or whatever branch).
- Mid-turn: same slot becomes
@abc1234 — the @ and SHA stay, the branch prefix is gone.
- Other slots (sandbox · cwd · context) stay painted. This is not a full pack clear.
- Not a detached-HEAD workspace as a lasting state — the branch name comes back when the turn ends.
Likely seam
formatGitStatusSlot (lib/agent/statusProbe.ts) is exactly this string when branch is missing:
const branch = res.branch ?? '';
const sha = res.sha ? `@${res.sha}` : '';
return `${branch}${sha}${res.dirty ? '*' : ''}`;
probeGitStatus also deletes branch when rev-parse --abbrev-ref HEAD returns HEAD (detached).
Phase 2 live pack (#627) re-probes git mid-turn on every successful exec (and on meta_sandbox_switch). The 10 s cadence Busy-skips, so the mid-turn on-demand probe is the only refresh during the turn. A plausible race:
- Agent
exec is still holding a git lock / mutating HEAD.
- Host on-demand probe runs
rev-parse --abbrev-ref HEAD + --short HEAD in parallel.
- Branch command fails or returns
HEAD → branch stripped; SHA still succeeds.
- Slot is replaced with
@sha. Fail-soft is supposed to keep the last git value on probe failure, but a partial result ({ sha } with no branch) is treated as success and overwrites the honest branch@sha.
Goal
- Mid-turn git slot keeps the last honest
branch@sha[*] unless the probe returns a new real branch (or a real detached-HEAD we choose to show).
- A SHA-only /
HEAD-stripped probe must not clobber a previously painted branch.
- Detached HEAD as a lasting workspace state can still omit the branch (today's
HEAD reject) — but a transient mid-turn miss must not look like that.
Non-goals
- Full git UI / checkout.
- Changing
STATUS_PROBE_MIN_INTERVAL_MS or the 10 s Busy-skip cadence.
- DOM status chips.
Related
Suggested next: confirm whether the mid-turn @sha is a SHA-only probe overwrite vs a paint clip, then fail-soft unless branch is a real name.
Summary
The status-bar git slot (line 2,
branch@sha[*]) loses the branch name while a turn is in flight and paints only@<short-sha>. Idle / post-turn it is the fullbranch@shaagain.Observed
done: git slot ismain@abc1234(or whatever branch).@abc1234— the@and SHA stay, the branch prefix is gone.Likely seam
formatGitStatusSlot(lib/agent/statusProbe.ts) is exactly this string whenbranchis missing:probeGitStatusalso deletesbranchwhenrev-parse --abbrev-ref HEADreturnsHEAD(detached).Phase 2 live pack (#627) re-probes git mid-turn on every successful
exec(and onmeta_sandbox_switch). The 10 s cadence Busy-skips, so the mid-turn on-demand probe is the only refresh during the turn. A plausible race:execis still holding a git lock / mutating HEAD.rev-parse --abbrev-ref HEAD+--short HEADin parallel.HEAD→ branch stripped; SHA still succeeds.@sha. Fail-soft is supposed to keep the last git value on probe failure, but a partial result ({ sha }with no branch) is treated as success and overwrites the honestbranch@sha.Goal
branch@sha[*]unless the probe returns a new real branch (or a real detached-HEAD we choose to show).HEAD-stripped probe must not clobber a previously painted branch.HEADreject) — but a transient mid-turn miss must not look like that.Non-goals
STATUS_PROBE_MIN_INTERVAL_MSor the 10 s Busy-skip cadence.Related
lib/agent/statusProbe.ts—probeGitStatus,formatGitStatusSlot(HEADreject +@shawhen branch empty)lib/harnessChat.ts— mid-turnrefreshGitStatusSlotafter successfulexec/ switch (plan: live status bar — phase 2 — live workspace pack (cwd · switch · git) #627)app/api/harness/status/route.ts— probe route; rate-limit returns cached last valuedocs/harness-limits.md— git slot =branch@sha[*]Suggested next: confirm whether the mid-turn
@shais a SHA-only probe overwrite vs a paint clip, then fail-soft unlessbranchis a real name.