Skip to content

Hold the first field add to an unread built-in type and return its schema - #4389

Merged
mstomar125 merged 2 commits into
mainfrom
issue-4341-read-schema-first
Nov 26, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-4341-read-schema-first

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

The read-the-schema half of the add-a-field procedure (the every-node sentence was already added after the turn). In an unbound chat the procedure skill is not pinned, and the model called update_schema with add_fields on a built-in type without reading it. schema_to_read_before_adding_a_field holds the first such call per built-in type per turn: the call is not run, and the error result carries the type's fields and custom_fields (read through get_node) and tells the model to say the type is built in and the field will exist on every node of the type in this database, then repeat the call. A get_node of the type earlier in the turn counts as the read; user-made types and other update_schema changes are not held. The refused call is released from the duplicate-call set so the retry is not read as a loop.

packages/agent lane: signed off by the owner for this batch. Not security-sensitive.

Tests (agent_loop::tests, 432 pass): 4 new, each mutation-checked on its own, each failing under its mutation:

  • the_first_field_added_to_a_built_in_type_unread_is_held_with_its_schema: fails when the result drops the schema, and when the hold repeats on the retry.
  • a_schema_the_turn_read_is_not_held: fails when a get_node read is not recorded.
  • only_a_field_add_to_a_built_in_type_is_held: fails without the built-in check.
  • an_unread_add_to_a_built_in_type_reads_the_schema_then_lands_once (whole turn): fails when the refused call stays in the duplicate-call set.
    Six existing field-added tests now script the read first. bun run quality:fix and bun run test:changed pass.

Not verified: the live 4B model (CPU/GPU) following the hold.

Closes #4341

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Addressed: the hold now carries a code and is exempt from the failed_tools reply replacement and the refusal notice's others list; node-URI reads count. A second update_schema on the same type in the same round still goes through unheld (known limit). The declined-work hold has the same exposure (is_declined_work_hold is not exempted in either filter); not changed here.

🤖 Generated with Claude Code

mstomar125 and others added 2 commits November 26, 2026 13:07
… not read, and return the schema

The add-a-field procedure starts with reading the schema, but it is pinned
only in a type-bound chat, and in an unbound chat the model added the field
without reading. The first update_schema add_fields call on a built-in type
the turn has not read via get_node is held once per type per turn; the result
carries the type's fields and custom_fields and asks for the built-in and
every-node statement. The retry goes through.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A model that stops after the hold to ask the user is doing what the hold asked,
so the hold carries a code and is exempt from the unsurfaced-failure reply
replacement and the refusal notice's failure list. A get_node read by
nodespace:// URI counts as the read.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-4341-read-schema-first branch from 8805cae to 9986f48 Compare November 26, 2026 12:07
@mstomar125
mstomar125 merged commit 78c520b into main Nov 26, 2026
@mstomar125
mstomar125 deleted the issue-4341-read-schema-first branch November 26, 2026 12:07
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.

Adding a field to a built-in type from an unbound chat skips the read-the-schema step and never says the field exists on every node

1 participant