Skip to content

Tool parameter named properties is silently deleted from the rendered tool schema — create_node/update_node guidance never reaches the model #2123

Closed

Description

@malibio

Summary

A tool parameter named properties is silently deleted from the rendered tool schema before the model sees it. The Gemma-4 chat template collides the parameter key properties with JSON Schema's own properties keyword while walking the nested schema, and drops the parameter along with its entire description.

create_node and update_node both take a parameter named exactly properties. It carries every field value on every write, and its description is one of the most heavily tuned strings in the system — including the allowed_values rule and the custom:-prefix rule from ADR-063.

The model never sees any of it.

Found while deriving the structural reference for #2122 (golden prompt corpus) via NODESPACE_PROMPT_DUMP. No production source was modified.

Reproduction

Minimal, using the merged golden-prompt utility from #2118 — no daemon, no DB, no gRPC:

name = "probe"
reps = 1

[[turn]]
system = "probe"
user = "probe"

  [[turn.tool]]
  name = "update_node"
  description = "Update an existing node's content or properties immediately."

    [turn.tool.parameters_schema]
    type = "object"
    required = ["id"]

      [turn.tool.parameters_schema.properties.id]
      type = "string"
      description = "Node ID to update"

      [turn.tool.parameters_schema.properties.content]
      type = "string"
      description = "New content/text for the node (optional)"

      [turn.tool.parameters_schema.properties.properties]
      type = "object"
      description = "Properties to merge/update ... When a field lists allowed_values, use one of those values exactly."
NODESPACE_PROMPT_DUMP=/tmp/dump.jsonl \
  cargo run --release -p nodespace-agent --bin golden_runner -- --reps 1 <case>.toml

Rendered result (420 chars) — id and content survive, properties is gone:

update_node{description:<|"|>Update an existing node's content or properties immediately.<|"|>,
parameters:{properties:{
  content:{description:<|"|>New content/text for the node (optional)<|"|>,type:<|"|>STRING<|"|>},
  id:{description:<|"|>Node ID to update<|"|>,type:<|"|>STRING<|"|>}
},required:[<|"|>id<|"|>],type:<|"|>OBJECT<|"|>}}

grep allowed_values against the full post-template prompt: not present.

The trigger is the key name

Control — byte-identical case with the parameter renamed properties → field_values:

arm rendered? allowed_values guidance reaches model? prompt len
parameter named properties no no 420
parameter named field_values yes yes 694

Nothing else changed. Nesting depth, the presence of a description, and sub-properties are all ruled out: a probe with bare_obj, rich_obj (with declared sub-fields), and an enum field all rendered correctly in the same run — only the key literally named properties vanished.

Where it happens

Not in our Rust. packages/nlp-engine/src/chat/mod.rs:1266 passes t.parameters_schema through intact into the OpenAI-format tool JSON. The loss occurs downstream inside llama.cpp's embedded Gemma-4 Jinja template when it walks the nested schema.

Since the template is upstream, the fix belongs on our side.

Why this likely matters more than it looks

Several long-standing, separately-investigated symptoms are consistent with "the guidance that explains how to fill properties is invisible to the model":

Each was previously treated as a prompt-tuning problem. If the parameter carrying those values is absent from the schema, no amount of rewording that description can reach the model — it is deleted after the wording is chosen.

Worth re-measuring the affected cases after a fix rather than assuming; the point here is that the channel was never open.

Suggested fix

Rename the wire parameter on create_node and update_node from properties to a non-colliding name (field_values verified working). This is a tool-schema change in packages/agent/src/local_agent/tools.rs plus the params structs that deserialize it — serde(alias) already handles the node_id/id precedent for accepting both spellings if wanted during the change.

Per ADR-064 rule 1 (tool schemas own argument shape), this is squarely a schema-channel fix.

Scope note

This is not #2122 (which touches no production source) and not #2120 as currently written (which reproduces tuned golden strings). It is a prerequisite defect: a golden authored against a properties parameter is authoring text the model provably cannot see. #2122 will author its write-tool cases against a non-colliding parameter name and record the dependency.

🤖 Generated with Claude Code

Activity

  1. malibio commented on Aug 18, 2026

    @malibio
    CollaboratorAuthor

    Scoping addendum — acceptance criteria and blast radius

    The original body diagnoses the defect but never states a done condition, and it does not bound what the rename touches. Both added here so this can be picked up cold.

    The change is narrower than a repo-wide grep suggests

    grep -rn properties packages --include="*.rs" returns a large number of hits. Almost none of them are in scope. Two distinct concepts share the word:

    concept rename?
    the wire parameter name on the agent's create_node / update_node tools yes — this is the whole fix
    the storage-layer properties map on a node (node_service, node_ops, markdown, the DB schema, every test fixture) no — different concept, leave alone

    The defect is purely that a tool parameter named properties collides with JSON Schema's own properties keyword when the Gemma-4 template walks the nested schema. Nodes can keep storing a properties map forever; only the argument the model is asked to produce needs a different name.

    Concretely in scope:

    • packages/agent/src/local_agent/tools.rs:78 — AgentCreateNodeParams.properties
    • packages/agent/src/local_agent/tools.rs:92 — AgentUpdateNodeParams.properties
    • the two parameters_schema JSON literals in def_create_node() and def_update_node() that declare the parameter and carry its (long, tuned) description
    • wherever exec_create_node / exec_update_node read those fields, plus their flat-extras scans

    Both structs are private to that file, which is what keeps the change small.

    On accepting both spellings

    The body mentions serde(alias) as an option. Worth being explicit: an alias is not needed for correctness here. There is no persisted data and no external caller — the only producer of this argument is the model, and it produces whatever the rendered schema tells it to. Per the repo's no-backward-compatibility rule, prefer the clean rename. An alias would also keep the broken spelling alive in a way that is invisible at the template layer, which is how this defect stayed hidden.

    Verifying the fix

    The measurement loop is the golden runner from #2118 — no daemon, no DB:

    NODESPACE_PROMPT_DUMP=/tmp/dump.jsonl \
      ./target/release/golden_runner --reps 1 packages/agent/goldens/dev-status-change-enum.toml

    Then confirm the parameter and its description survive into the post-template string. That is the only layer where this defect is visible — --check (pre-template) shows the parameter present either way, which is precisely how it went unnoticed.

    Reference measurement from the original diagnosis: same case, one word changed, 420 chars rendered with properties vs 694 with field_values, with the allowed_values rule reaching the model only in the second.

    Why the name matters for what comes next

    #2122's corpus (merged, 44ef2f1f) authored every write case against field_values, because tuning against a parameter the model never receives is not possible. Its PATTERN.toml also establishes that write tools must declare each field as a typed sub-property — declarations that would be equally invisible inside a deleted parameter.

    So if this is fixed by renaming to something other than field_values, the corpus files need updating to match, and their recorded measurements need re-taking. Renaming to field_values makes the corpus correct as written. That is a reason to prefer it, not a requirement.

    Acceptance criteria

    • create_node and update_node declare their value parameter under a non-colliding name (field_values unless there is a reason to differ)
    • The parameter and its full description appear in the post-template prompt, verified via NODESPACE_PROMPT_DUMP — not via --check, which cannot see this class of defect
    • The storage-layer properties concept is untouched
    • A test asserts the rendered tool schema contains the value parameter, so a future collision fails loudly rather than silently. Note this must assert against the post-template string; a pre-template assertion would have passed throughout the defect's lifetime
    • Re-measure the previously-affected behaviours rather than assuming they improve: update_node called with an id and no values, invented property keys, enum values not drawn from allowed_values. Each was investigated as a prompt-tuning problem while the guidance was provably unreachable; whether they resolve is an open question, not a foregone conclusion
    • If the chosen name is not field_values, the Author and tune the golden prompt corpus: production-shaped, dev-domain prompt strings #2122 corpus files are updated and re-measured, and PATTERN.toml's dependency note is revised

    Related

    🤖 Generated with Claude Code

  2. mstomar125 commented on Aug 18, 2026

    @mstomar125
    Contributor

    Resolved in #2144.

    Renamed the wire parameter on create_node/update_node from properties to field_values (no back-compat alias, per this repo's greenfield policy) and updated every real call site: the tool schema definitions and deserializing params structs in tools.rs, the flat-extras promotion lists and error messages, agent_loop.rs's splice-repair user-data key list, the Node Creation / Graph Editing skill guidance markdown, and local_agent_service.rs's terse_write_fact history renderer (which was reading a completed write's recorded arguments by the old key).

    Verified with the golden-runner probe from this issue's own reproduction: with the parameter renamed, the post-template prompt goes from 420 chars (parameter silently dropped) to 592 chars (parameter present, allowed_values guidance reaching the model). Also verified live end-to-end against the locked model: scenario6_update_node_properties (issue #1927's exact reproduction) now gets update_node({"field_values":{"isReturned":true},...}) 3/3 trials, where it previously reproduced the silent no-op.

    Full details and test plan in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions