Skip to content

fix(dispatcher): wake idle units on inferred read binds - #2366

Merged
justinhelmer merged 1 commit into
mainfrom
codex/held-unit-routing-2265
Sep 25, 2026
Merged

justinhelmer merged 1 commit into
mainfrom
codex/held-unit-routing-2265

Conversation

@justinhelmer

Copy link
Copy Markdown
Contributor

Replies in an idle plan unit's thread now reach that original unit even when the operator infers a read command. Explicitly typed read commands still run.

Why: A request to address nominal #3808 review comments was answered with plane show, leaving the original U4 unit unwoken. This closes the held-unit routing path recorded in switchboard #2265 without creating another writer or changing unit identity.

Where to look

  1. Owned-unit decision guard An inferred read bind folds into the idle unit's durable event path.
  2. Regression proof An action request wakes the unit; an explicitly typed plane show still runs.
  3. Admission contract The spec states the owner-preserving routing rule and its proof.

Feedback wanted: Check that unit-owned natural-language replies should always reach the unit, while typed read commands remain available.

Risk: A natural-language status request in an idle unit thread now wakes that unit; users can type a read command for an immediate status answer. The separate pre-PR publication gap in #2265 remains open.

Verified: Red-first regression; 661 dispatcher/operator tests pass. Typecheck, spec, hygiene, formatting and diff checks pass.

Decisions (1)
  • Prefer unit ownership over inferred reads. The operator's inferred read intent can misclassify an action request. Only the person's typed command is strong enough to bypass the original unit's follow-up path.
Validation (3 criteria)
Criterion Proof
An inferred plane show cannot consume an action request in a held unit thread. The regression fails before the guard (plane.show ran) and passes after it, with exactly one original-unit wake event and zero new runs.
An explicitly typed read command remains usable. The same test sends literal plane show, observes plane.show, and sees no additional unit event.
Related routing behavior stays intact. npx vitest run src/core/dispatch/operator.test.ts src/core/dispatcher.test.ts: 661 passed. Scoped typecheck, specs, hygiene and Prettier checks passed.
For agents

Review only this held-unit routing fix. The original PostHog U4 writer and PR #3808 remain separate; this PR does not claim the F2 preview receipt or repair #2265's pre-PR continuation path. Person merge and exact release validation remain required.

🤖 Generated with Claude Code

@justinhelmer justinhelmer changed the title fix(dispatch): wake idle units on inferred read binds fix(dispatcher): wake idle units on inferred read binds Sep 25, 2026

@coreplane-switchboard coreplane-switchboard Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: The routing fix is sound, but the numbered thread-admission behavior still contradicts the new idle-unit rule.

Warning

Changes requested · head 5c97357 · 1 finding: 1 minor

Severity Finding Where
minor F1 Spec contradiction — thread-admission.md item 9: inferred reads now fold for idle units although the behavior says reads run docs/reference/specs/thread-admission.md:28
Full review

F1: Item 9 still says read-command decisions run when either a live run or idle unit owns the thread. The implementation now folds inferred reads for idle units, as the new validation row states. Update the numbered behavior to distinguish idle-unit inferred reads from live-owner reads and explicitly typed commands.

@justinhelmer
justinhelmer force-pushed the codex/held-unit-routing-2265 branch from 5c97357 to c726030 Compare September 25, 2026 21:24
@justinhelmer
justinhelmer force-pushed the codex/held-unit-routing-2265 branch from c726030 to 4240cf9 Compare September 25, 2026 21:24

@coreplane-switchboard coreplane-switchboard Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: The item 9 update resolves F1 and the full PR remains consistent with its regression coverage.

Note

Approved · head 4240cf9 · no findings

Full review

F1 is resolved at the new exact head; no findings remain.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: coreplane-switchboard[bot] reviewed this PR and posted an LGTM verdict (see its review). This repository opted in through its REVIEW_BOT_LOGIN and REVIEW_BOT_ID variables.

@coreplane-switchboard

Copy link
Copy Markdown
Contributor

Source-overlap coordination for the separate original-unit recovery extension requested in this thread, on plan/implement-the-separate-o-8dd912/u1.

I inspected exact head 4240cf94fc20fba3e6d0e260c1949c8b84f7d25d: this PR changes src/core/dispatch/operator.ts, adds the inferred-read/explicit-read regression in src/core/dispatcher.test.ts, and updates thread-admission.md. The extension plan also requires dispatcher.test.ts; it must preserve this focused owner-routing fix, not replace or absorb it. No extension source has been edited.

Holding the overlapping path pending confirmation of its reservation/serialization boundary (this PR's exact-head review versus any further fix writer). The extension will rebase onto containing main before review. This is coordination only: no request to merge, deploy, start a writer, or recover any product unit. Draft #1625 remains unrelated; pricing-validation #2368 is outside the extension's scope.

@justinhelmer
justinhelmer merged commit 1d96da6 into main Sep 25, 2026
30 checks passed
@justinhelmer
justinhelmer deleted the codex/held-unit-routing-2265 branch September 25, 2026 21:35
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