Repository navigation
fix(planner): read a document this one created with orchestrate read - #1049
Merged
Merged
Conversation
A fan-out document's Planner called `read_child` with the id of a document it had opened with `orchestrate` and was told "no such child document". Chopin has two kinds of related document: ones nested in this one (`parentChannelId`, reached by the child tools) and separate top-level documents this one created (`createdFrom`, reached by `orchestrate`). The prompt only taught the first, and `orchestrate` could not read a created document at all. - `orchestrate` gains a read-only `read` operation: one created `target` (id or url) with `offset`, `limit` and `column`, returning the same view `read_plan` and `read_child` give, held under the document's archive hold and refused for a document not created from this one, archived or deleted. The model reads it as paged text with a `next:` call; MCP `orchestrate` mirrors it (read access is enough) with the same paged text. - `read_child`, `edit_child` and `anchor_child` given the id of a document this one created say it is a separate document and to read it with `orchestrate` `read` and change it through `instruct`; any other id keeps the generic refusal. - The prompt, tool descriptions and docs call the first kind nested documents and the second documents this one created, never both child documents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fan-out document's Planner called
read_childwith the id of a document it had opened withorchestrate(oneorchestratelistshowed) and was refused with "no such child document of this document". Chopin has two kinds of related document: documents nested in this one (parentChannelId, such as published research, reached bylist_children/read_child/edit_child/anchor_child) and separate top-level documents this one created (createdFrom, reached byorchestrate). The prompt only taught the nested kind, both were called "child documents" in places, andorchestratehad no way to read a created document, so a model that wanted to read one reached forread_child.What changed
orchestrateread(Planner host tool and MCPorchestrate): takes onetarget(id or url, asanswerdoes) andoffset/limit/column, and returns the viewread_plan/read_childgive (document,revision,blocks,questions, acceptedcomments,source) withtargetnaming it. It reaches only documents this one created (same repository, top-level, unarchived), reads under the document's archive hold (withHeldPlaninmain.ts,serializeDocument+withOpenedPlanover MCP) and rechecks there, so a document archived meanwhile is refused (target-not-created). A range outside the document isinvalid-range. It never writes: a created document's own Planner and members edit it, and a change is asked for withinstruct. Over MCP it is read-only likelistanddecisions(pull access is enough); on the Planner it has the same person-request gate as everyorchestrateoperation.readingOutputshows a successfulorchestratereadto the model as the same line-addressable textread_plangives, withnext: orchestrate {"operation":"read","target":…,"offset":…}; MCP's text result is the same, with the sourceidin itsnext:call. Other operations and refusals are left as returned.read_child,edit_childandanchor_childgiven the id of an unarchived document this one created now answer<id> is not nested in this document: it is a separate document this one created, with its own Chat and Planner. Read it with orchestrate {"operation":"read","target":"<id>"}, and change it by sending its Planner an orchestrate instruct.Every other id keeps the generic refusal (now "no such child document nested in this document"), so nothing is revealed about documents outside that relationship.orchestrate's descriptions and schema, MCPorchestrate's description, the focus line and the docs (AGENTS.md,hosted-agent.md,local-agent-mcp.md,channels.md,agent-connection.md) say "nested documents" (child documents nested in this one) for the first kind and "documents this one created" for the second, the vocabulary the index heading (Documents created from this one) and docs already used. Each description says in a sentence why the other kind is out of its reach.Verification
bun run fix,bun run ci,bun run typespass.orchestratereadarguments, reads of a created document (by url and id, with ranges), refusals for a document this one did not create, one created by a created document, this document, an archived one and one archived while waiting for its hold (agent/orchestrate.test.ts); the model's paged text and itsnext:call; the child tools' refusal for a created document versus an archived or unrelated one (agent/child-tools.test.ts); prompt and description text (agent/planner.test.ts,agent/child-tools.test.ts); the MCP mirror end to end, including a pull-only caller, paged text, refusals, an archived target and the advertised schema (mcp/orchestrate.test.ts).bun test apps/server/src/agent apps/server/src/chat apps/server/src/mcp apps/server/src/harness: 2395 pass. Fullbun test: 10125 pass; the only 2 failures (ai/launch-handoff.test.ts,experiments/routes.test.ts) come from this machine's global git commit-signing config and pass withGIT_CONFIG_GLOBAL=/dev/null.