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
The run-id branch an agent branched away from goes with its checkout (#1657) (#1658)
* The run-id branch an agent branched away from goes with its checkout (#1657)
A run starts on `tf-agent-<id>`; the system prompt then has the agent create
`tf-<name>` and check it out, so the rename never applies and the run-id
branch stays behind at the commit the run began from — one per run, forever.
The rig had nine after two days, two of them pushed to origin by the old
teardown.
Removal now judges the run-id branch alongside the checkout's: when the
checkout ended on another branch that contains it, everything it holds is held
again, and it goes with the checkout. One carrying a commit the kept branch
lacks stays. Decided before either delete, since the containment reads both
refs. The result and the removal lines name every branch that went.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* The guard test branches from the init commit, not from a branch named main (#1657)
CI's git init names its first branch master.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: FEATURES-SPEC.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ happens while nobody is at the keyboard.
129
129
- CI watch: merge a PR once its checks pass
130
130
- CI watch: one fix agent per red head commit, max two attempts
131
131
- Reclaim the checkout of an agent whose work is on the remote — never by publishing what a `handoff: local` agent refused to
132
-
- An agent that committed nothing leaves no branch behind: its empty branch goes with its checkout, never pushed, so a pinned routine is not stood down by its own last run
132
+
- An agent that committed nothing leaves no branch behind: its empty branch goes with its checkout, never pushed, so a pinned routine is not stood down by its own last run — and the run-id branch it started on goes too, once the branch it moved to holds everything the run-id branch did
133
133
- A directory under `branches/` that git does not know as a worktree is never committed, pushed, linked or deleted through — it is reported and left alone, so a leftover can never stand in for your own checkout
134
134
- Release a pinned routine branch left behind by a closed PR — before the schedule fires the routine, and before its "Run now" does
135
135
- The agent drains its own TODO backlog, one entry per turn
assert.match(lines[0]??'',/Thebranchandthesessionarekept/,'a checkout vanishing silently reads as a bug')
120
-
assert.match(lines[1]??'',/removedtheworktreeforsessionr2anditsbranchtf-triage-quick:thebranchheldnothing/,'a branch going says so (#1650)')
120
+
assert.match(lines[1]??'',/removedtheworktreeforsessionr2anditsbranchestf-triage-quickandtf-agent-r2:nothingonitismissingelsewhere/,'branches going say so (#1650, #1657)')
/** A running sweep, in the shape the daemon's other background services use. */
97
102
exportinterfaceMergedWorktreeSweep{
98
103
/** Run one sweep now, awaiting it. Exposed for tests and for a caller that wants it on demand. */
@@ -144,8 +149,8 @@ export function startMergedWorktreeSweep(opts: MergedSweepOptions): MergedWorktr
144
149
for(constitemofremoved){
145
150
announced.delete(item.agentId)
146
151
opts.log(
147
-
item.branchDeleted
148
-
? `[framework] removed the worktree for session ${item.agentId} and its branch ${item.branchDeleted}: the branch held nothing the remote lacks. The session is kept.`
152
+
item.branchesDeleted
153
+
? `[framework] removed the worktree for session ${item.agentId} and ${describeDeleted(item.branchesDeleted)}: nothing on it is missing elsewhere. The session is kept.`
149
154
: `[framework] removed the worktree for session ${item.agentId}: its branch is on the remote. The branch and the session are kept.`,
0 commit comments