Skip to content

Stop finished leaves from re-inferring after a report reply - #688

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7068-finished-leaf-re-infers-after-valid-report-envelope
Aug 25, 2026
Merged

Stop finished leaves from re-inferring after a report reply#688
TheGreatAxios merged 2 commits into
mainfrom
cl-7068-finished-leaf-re-infers-after-valid-report-envelope

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Fence SubAgentDirector after a terminal report reply (complete / salvage) so empty idle-compact and stall continuations return wait instead of falling through to DefaultDirector.infer.
  • Only a non-empty parent message (followup_task / send_input) clears the fence and re-opens the brief.
  • Regression coverage for envelope → empty/stall → no infer, plus parent follow-up reopen.

Fixes the subagent-54 loop: valid report → tool-less "Done." nudge → same report every ~subAgentStallTimeoutMs.

Closes CL-7068
https://linear.app/abklabs/issue/CL-7068/finished-leaf-re-infers-after-valid-report-envelope-incomplete-report

Test plan

  • bun test ./src/subagent/nudge-director.test.ts (16 pass, including three CL-7068 cases)
  • bun test ./src/subagent/ (303 pass)
  • bun run typecheck / bun run build / lint (0 errors)
  • CI green on the PR

Empty idle-compact and stall continuations were falling through to
DefaultDirector.infer after SubAgentDirector already replied with a
valid report envelope, which revived the brief about every stall
timeout on persist sessions (CL-7068). Fence those empty events once
reportReplied is set; only a non-empty parent message re-opens work.
@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

CL-7068

Salvage, idle-compact meter, and a second empty continuation after a
terminal report reply must wait without re-inferring. Prior cases only
exercised a single empty ping with no continuation channel.
@TheGreatAxios
TheGreatAxios merged commit e8625d2 into main Aug 25, 2026
5 checks passed
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
* Stop finished leaves from re-inferring after a report reply

Empty idle-compact and stall continuations were falling through to
DefaultDirector.infer after SubAgentDirector already replied with a
valid report envelope, which revived the brief about every stall
timeout on persist sessions (CL-7068). Fence those empty events once
reportReplied is set; only a non-empty parent message re-opens work.

* Cover post-report wait paths the fence left untested

Salvage, idle-compact meter, and a second empty continuation after a
terminal report reply must wait without re-inferring. Prior cases only
exercised a single empty ping with no continuation channel.
TheGreatAxios added a commit that referenced this pull request Aug 27, 2026
* Stop finished leaves from re-inferring after a report reply

Empty idle-compact and stall continuations were falling through to
DefaultDirector.infer after SubAgentDirector already replied with a
valid report envelope, which revived the brief about every stall
timeout on persist sessions (CL-7068). Fence those empty events once
reportReplied is set; only a non-empty parent message re-opens work.

* Cover post-report wait paths the fence left untested

Salvage, idle-compact meter, and a second empty continuation after a
terminal report reply must wait without re-inferring. Prior cases only
exercised a single empty ping with no continuation channel.
@TheGreatAxios
TheGreatAxios deleted the cl-7068-finished-leaf-re-infers-after-valid-report-envelope branch August 28, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant