Repository navigation
Create the agent's create_node through the document path the CLI uses - #4275
Merged
Merged
Conversation
exec_create_node calls node_ops::create_document_node instead of create_node, so a text, task, project, spec, plan or decision (and the types that extend them) given a markdown document gets the same tree as `nodespace node create`: first line the title, front matter the fields, the rest parsed into children, with the same type allow-list, caps and errors. Single-block content and every other type are stored as given. The result reports child_count when a body was written, and the tool description says content may be a document. Adds parity tests and updates the tool-surface golden. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ace a failure The descendants query runs only when the content has a line break, and a failure to read it is returned instead of dropping child_count. The tool description now names the document case as the exception to "title and nothing else" and points imports at create_nodes_from_markdown. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
agent-create-node-document
branch
from
November 13, 2026 11:14
776a9df to
87aae59
Compare
17 tasks
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.
What
The in-app agent's
create_nodenow callsnode_ops::create_document_node(the function behind the CLI'sCreateDocumentRPC) instead ofnode_ops::create_node. No parsing is re-implemented. The same text through the tool and through the CLI gives the same tree: same child types and order, same title rule (first line), same front-matter handling (tocustom:/declared properties on the root), same document-type allow-list, same 1 MB / 1000-node caps and error messages (the tool wraps the core message ascreate_node failed: ...).The result carries
child_countwhen a body was written, and the tool description tells the modelcontentmay be a document.Why
User decision on #4237: the agent tool takes document markdown like the CLI.
Non-document types
The allow-list is text, task, project, spec, plan, decision, plus types extending them (issue, software-project, custom types that extend one). Everything else (header, code-block, quote-block, table, person, date, collection, schema, plain custom types like
ticket) keeps multi-line content as given, as before; verified by a test withquote-block. Single-block content with no front matter is stored as given for every type.Parity test
create_node_document_parityinpackages/agent/src/local_agent/tools.rs:the_tool_and_the_cli_path_give_the_same_tree(text, task, decision; front matter, header, paragraph, ordered list, checkbox, code fence): fails on main (tool leaves the whole text in one node), passes now.a_bad_first_line_is_refused_with_the_cli_message: fails on main (tool created a node), passes now.a_block_type_keeps_multi_line_content_wholeanda_single_line_is_stored_as_given: guards. Mutation: removing the allow-list in core makes the block-type test fail; removingchild_countmakes the tree test fail. The single-line test holds under every mutation I tried (core also stores a single line as given), so it is a regression guard only.Risk review of existing flows
Grepped seeds/rules, guidance, goldens, evals, and the agent tests. Seeded rules create one node per call with one-line or one-paragraph content (decision-create, skill-authoring-create, section-create, task-review-*, task-breakdown-create, spec/plan create), so they are unchanged in behaviour;
task-review-note/decision-createtext with several paragraphs would now become a root plus children instead of one multi-line node. Bulk import still goes throughcreate_nodes_from_markdown, untouched. No seed changed, so no shape-record entry is needed (shape files untouched). The only snapshot affected isstage2_tool_surface.golden(tool description), regenerated. The oldergoldens/*.tomlablation files embed historical tool text and are not checked against the live description. All 1056 agent lib tests and the prompt snapshot tests pass (one unrelated test,a_held_update_nodes_schema_decision..., failed once in a full run and passed on every rerun and on main in isolation).Limits
1 MB content and 1000 nodes per call (core's
MAX_MARKDOWN_SIZE/MAX_NODES_PER_IMPORT). Root and body are two transactions; on body failure the root is deleted and the call fails (core behaviour).Not run: live model runs (handled separately), so the new description sentence is unmeasured against the model.
Refs #4237
🤖 Generated with Claude Code