Skip to content

Handoff: let idle compaction run when the handoff's model instance cannot run; fix the 'not remembered' test #608

Closed

Description

@scuttletoby

Follow-up from the review of #605 (#605 (comment)). #605 corrected the docs; this is the code side and one test gap.

  1. Let idle compaction run when the handoff cannot run (major in the review, came with fork(handoff): one owner per thread; project-off tests (#361) #583). When the handoff's modelSelection names a provider instance that was removed, the send fails before any run (ProviderAdapterRegistryLookupError), so there is no retry and nothing shows in the thread. Idle compaction is skipped for that thread for good, with only server-log lines. Fix: the compaction wrapper (handoffOwner.ts) treats a thread as handoff-owned only if the handoff can run: check settings.modelSelection?.instanceId (when set) with upstream's own resolveProjectProviderInstanceEnabled and a registry lookup. HandoffService uses the same rule (one source), so the two never disagree. Also trace the "turned off but still registered" case. Update docs/fork/handoff.md ("A handoff that cannot run") to match.
  2. The "is not remembered" test cannot fail (handoffOwner.test.ts:281). Each compaction(...) call builds a fresh HandoffOwner.make, so a result remembered inside one wrapper would not show (the reviewer's mutant D: a Set of missing thread ids inside make keeps all 102 tests green). Build the wrapper once and report the run twice, clearing threadMissing between the two reports.

State question for the fix: runs again, settings changed half-way, instance removed and then added back, old settings with no modelSelection.

🤖 Generated with Claude Code

Activity

  1. added 2 commits that reference this issue on Nov 21, 2026
    dd5488d
    7c674be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions