Repository navigation
fork seams: move orchestratorMcp.ts and OrchestratorMcpService.ts to seams, announce the #817 lines (step 1) - #965
Conversation
…seams, announce the #817 lines (step 1) Part of #817. List only: both files leave "pending" for seam entries that list their current fork lines (8 and 35), and announce the lines #817 adds: one spread of fork result fields plus its import in the contract, and one call in endsTaskWait so a pending secret request ends a blocking wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: code · reviewer: lens agent · read at: 60f5ac5 🤖 Generated with Claude Code |
|
lens: merge-path · reviewer: lens agent · read at: 60f5ac5
🤖 Generated with Claude Code |
|
lens: state · reviewer: lens agent · read at: 60f5ac5 🤖 Generated with Claude Code |
Problem
#817 (design in #808, row 1 follow-up) adds lines to two upstream files:
packages/contracts/src/orchestratorMcp.tsandapps/server/src/mcp/OrchestratorMcpService.ts. Both arependingin.github/fork-seams.json, and a pending file takes no new fork line. So perdocs/fork/updates.md("Adding a seam line", and the pending-to-seam move under "What guards it") they first become seam entries and the new lines get announced, in a list-only pull request. Then the #817 change goes in.Change
This changes only
.github/fork-seams.json. Neither file's text changes.pendingtofiles. The new entries list exactly the fork lines each file has today, counted from upstream: 8 in the contract (usage pacing'susagePacingNoteand theusage_pacing_hold/slots_fullcodes) and 35 in the service (theDelegateChecksseats). Those were the two ceilings. The service'slostentry ({"lines": 5, "gone": 5}) stays as it is. With seam entries, fork-follow holds each line to its entry, not just to a count.since2026-11-22; please refresh it if this merges on a later day). There are three lines in all: two in the contract and one in the service.packages/contracts/src/orchestratorMcp.ts. The import goes among the imports, and the spread goes inOrchestratorMcpDelegateTaskResultafternext:apps/server/src/mcp/OrchestratorMcpService.ts, as the first operand in upstream'sendsTaskWait:Why each line is needed, and why no existing fork hook can carry it
...ForkOrchestratorMcp.ForkDelegateTaskResultFields,). Contract fields for a linked child's secret requests and 'unknown'; a secret ends a wait (seam PR, #808) #817 adds two optional fields toOrchestratorMcpDelegateTaskResult:pendingSecretRequests(itemId,label,reason, never a value) and an "unknown" marker (promptsKnown: false). A field reaches the wire only when it is in thisSchema.Struct. The delegate/wait/status tools intoolkits/orchestrator/tools.tsencode with this schema, and the service builds results withsatisfiesagainst its type. Today the file has no fork hook into this struct. Its only fork lines are the inlineusagePacingNotefield and two error codes, and neither one can carry new fields. A single spread of fork-owned fields keeps the definitions, caps and patterns in the fork's own file (forkOrchestratorMcp.ts, which matches thefork*naming the check already takes as the fork's). It also means later fork fields on this result need no new line here. This is the same patternsettings.tsuses with...ForkSettings.*Fields.orchestratorMcp.tsimports no fork module today, so there is no existing import to reuse. Writing the two fields inline would avoid the import, but it would put the nested schemas and their annotations into upstream's file as several more fork lines, and the formatter wraps them over many lines.endsTaskWait.endsTaskWaitdecides when a blockingdelegate_task/task_statuswait returns. It is used for the first read inwaitForTask, as the stream filter that ends the wait, and inreadTask's choice ofnext. It is a module-level pure function that only ends onhasPendingQuestion,pendingApprovalor a terminal status, so a pending secret request can never end a wait (the gap Contract fields for a linked child's secret requests and 'unknown'; a secret ends a wait (seam PR, #808) #817 names). The existing fork seatdelegateChecks.remotePrompts(task, status)only shapes the result. It cannot change this decision unless it setshasPendingQuestionorpendingApprovalfor a secret. That would misreport it as a question or approval the agent is invited to answer, and Seamless fleet: every prompt from any machine (questions, approvals, secrets, sign-ins) shows up in the thread the owner reads #808 says secrets are never answered by an agent. ThedelegateChecksinstance frommakeis also not in scope at module level. The seat uses the module's existingimport * as DelegateChecks(already a seam line), so the service needs no new import: one line in total.Nothing else in this PR. The #817 change itself (the fork fields file,
promptEndsWait,remotePromptsfilling the fields, the watcher waking a live wait on a secret, and failing-first tests) is step 2. In that PR the three lines move fromannouncedtoadded.Verification
node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEADpasses. It notes that both moved entries "list exactly the fork lines counted from upstream" (it fetched upstream read-only to count them).node .github/scripts/fork-seam-check.cjs --from-upstream <merge-base of main and upstream> HEADpasses ("only the pinned seams", list from the head).node --test .github/scripts/fork-seam-check.test.cjs: 117 pass, 0 fail.vp run check:changed: format, typecheck (43 packages) and the one test it picked all pass.forkOrchestratorMcp.tsand a stubpromptEndsWait, all formatted withvp fmt. Judged with this branch's list as config, it passes ("only the pinned seams"). The commit was not pushed.Part of #817: this is step 1 of 2, the seam list. Still left: the contract fields, the
endsTaskWaitseat and the watcher change, with tests.🤖 Generated with Claude Code