Skip to content

Rename create_node/update_node's properties parameter to field_values - #2144

Merged
mstomar125 merged 2 commits into
mainfrom
issue-2123-properties-param-collision
Aug 18, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-2123-properties-param-collision

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

A tool parameter named exactly properties on create_node/update_node collides with JSON Schema's own properties keyword while llama.cpp's embedded Gemma-4 chat template walks the nested tool schema. The template silently drops the colliding parameter — and its entire description, including the heavily-tuned allowed_values rule and the custom:-prefix rule from ADR-063 — before the model ever sees it.

This renames the wire parameter on both tools from properties to field_values, with no backward-compat alias (per this repo's greenfield policy — zero users, zero production deployment), and updates every real call site that referenced the old name.

Closes #2123.

Root cause (confirmed, not this PR's fix site)

packages/nlp-engine/src/chat/mod.rs:1266 passes t.parameters_schema through intact into the OpenAI-format tool JSON — the loss happens downstream inside llama.cpp's embedded template, which is upstream and out of our control. The fix is therefore on our side: avoid the colliding name.

Changes

  • packages/agent/src/local_agent/tools.rs: renamed the properties key to field_values in both def_create_node()'s and def_update_node()'s parameters_schema, renamed the AgentCreateNodeParams/AgentUpdateNodeParams struct fields and their flat-extras KNOWN promotion lists, and updated the tool descriptions and error messages that referenced the old wire name.
  • packages/agent/src/local_agent/agent_loop.rs: updated repair_spliced_object_values's user-data key list (content/field_values) and its doc comments, and the regression tests exercising it (including the alias-normalisation test's nested-user-data case).
  • packages/agent/src/skill_pipeline.rs: updated the "Node Creation" and "Graph Editing" skill guidance markdown (and its two accessor tests) to reference field_values instead of properties.
  • packages/daemon/src/services/local_agent_service.rs: terse_write_fact — which renders a completed write's recorded arguments into a "Fact: ..." history line for the next turn — read a create_node/update_node call's field values via args.get("properties"). Updated to args.get("field_values"), since this reads a real executed call's canonical wire arguments. Added a regression test (terse_write_fact_reads_field_values_key) pinning this against the new key.
  • Live-model test fixtures (packages/agent/tests/live_update_node_noop_gate.rs, live_unset_schema_field.rs, packages/daemon/tests/scenario6_update_node_properties.rs, golden_scenario6_real_pipeline.rs) that call through the REAL production tool definitions (all_tool_definitions()) or feed real ToolExecutionRecords through completed_writes_from: updated their fixtures/assertions to the new key so they continue to validate production's actual shape.

Deliberately left unchanged: the node's own properties data field (as returned by get_node/search_nodes/query results) — that's a different concept, the stored node's typed fields, not the LLM tool-calling wire parameter. Also left unchanged: three test files (golden_scenario6_handauthored.rs, golden_scenario6_sequence.rs's tool definitions, and golden_scenario6_real_pipeline.rs's hand-authored update_node tool) that are explicitly documented as deliberately-minimal, hand-authored schemas independent of production (resolve_query/create_node/update_node re-implemented from scratch for an unrelated history-length experiment, #1917/#1922/#1925) — not real callers of the renamed production schema.

Verification

Golden-runner probe (the issue's own reproduction technique), NODESPACE_PROMPT_DUMP + cargo run --release -p nodespace-agent --bin golden_runner, against the locked native gemma-4-E4B-it-Q4_K_M.gguf:

parameter name rendered post-template prompt allowed_values guidance reaches the model
properties (before) 420 chars, parameter absent no
field_values (after) 592 chars, parameter present with full description yes

Live end-to-end regression — scenario6_update_node_properties::update_node_after_resolve_carries_the_changed_property, which drives the REAL production update_node tool definition against the locked model reproducing issue #1927's exact scenario:

UPDATE-STEP[trial 1] update_node({"field_values":{"isReturned":true},"id":"nodespace://laser-cutter-node"})
UPDATE-STEP[trial 2] update_node({"field_values":{"isReturned":true},"id":"nodespace://laser-cutter-node"})
UPDATE-STEP[trial 3] update_node({"field_values":{"isReturned":true},"id":"nodespace://laser-cutter-node"})

3/3 trials now correctly carry the requested state change — previously invisible because it lived under the colliding properties key.

Also ran live_update_node_noop_gate live: 3/3 reps persisted the requested state change via field_values, 0 rejected, 0 silent no-ops.

Test plan

  • cargo test -p nodespace-agent — 491 passed, 0 failed (1 ignored: live-model-only)
  • cargo test -p nodespace-daemon — 148 passed, 0 failed
  • cargo test --workspace --exclude nodespace-app — all green
  • cargo clippy --all-targets — clean
  • cargo fmt --check — clean
  • Golden-runner probe confirms the fix (420→592 chars, allowed_values now present)
  • Live scenario6_update_node_properties test: 3/3 trials correctly carry the state change
  • Live live_update_node_noop_gate test: 3/3 reps persist correctly
  • bun run test:all (frontend + Rust, pre-push gate) — passed

🤖 Generated with Claude Code

A parameter literally named `properties` collides with JSON Schema's
own `properties` keyword while llama.cpp's embedded Gemma-4 chat
template walks the nested tool schema, silently deleting the
parameter and its entire description (including the allowed_values
rule and the custom:-prefix rule) before the model ever sees it.
Confirmed via golden-runner probe: the same schema renders at 420
chars with the parameter named `properties` and 592+ chars with it
named `field_values`, with allowed_values guidance present only in
the latter.

Renames the wire parameter on both tools (schema definitions and the
deserializing params structs) with no back-compat alias, per this
repo's greenfield policy, and updates every real call site that
referenced the old name: the flat-extras promotion lists and error
messages in tools.rs, the splice-repair and alias-normalisation logic
in agent_loop.rs (including its regression tests), the Node
Creation/Graph Editing skill guidance markdown, and
local_agent_service.rs's terse_write_fact history renderer (which
extracted field values from a completed write's recorded arguments by
the old key). Live-model test fixtures that call through the real
production tool definitions are updated to match.

Adds a regression test pinning terse_write_fact against the new key,
and verifies the fix live end-to-end: scenario6_update_node_properties
now gets update_node({"field_values":{"isReturned":true},...}) 3/3
trials, where it previously reproduced #1927's silent no-op.
@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE

Reviewed the diff line-by-line, checked out the branch in an isolated worktree, and verified independently (not just re-reading the PR's own claims):

1. Completeness of the rename. Grepped packages/agent/src and packages/daemon/src for every "properties" occurrence and classified each. All remaining "properties" sites are legitimately out of scope: the JSON-Schema properties keyword on every other tool's parameter object (resolve_query, create_schema, search_nodes, etc.), the node's own stored properties data field as returned by get_node/search_nodes/resolve_query, the ops-layer CreateNodeInput.properties/NodeUpdate::with_properties internal field, and two unrelated repair-function tests (repair_over_quoted_keys, repair_leaked_special_token_keys) that use "properties" as an arbitrary example key unrelated to the collision fix. No missed wire-arg site found in Rust, and no stray references in TS/JS (scripts/eval/*, skill shims, desktop-app) — the eval matrix's minProperties reads derived fieldCount/contentOnly result fields, not the raw wire key, so it's unaffected either way.

2. Diff correctness. AgentCreateNodeParams/AgentUpdateNodeParams struct fields, both KNOWN flat-extras arrays (create: content/node_type/field_values/parent_id; update: id/node_id/content/field_values, matching #[serde(alias = "node_id")] on id), the repair_spliced_object_values key check, and terse_write_fact's two .get(...) call sites all correctly renamed with no typos or mismatches.

3. Test coverage. Verified terse_write_fact_reads_field_values_key empirically by reverting just the update_node arm's key back to "properties" in a scratch copy — the test fails with a clear assertion message, confirming it actually pins the fix rather than passing vacuously. golden_scenario6_handauthored.rs/golden_scenario6_sequence.rs correctly left untouched — confirmed they build fully hand-authored ToolDefinitions locally and never import all_tool_definitions() or production's Tool::*.definition(), so they're genuinely independent of this rename.

4. Scope discipline. File list is exactly the 8 files described — no nlp-engine, no agent_guidance.rs/routing.rs/prompt_assembler.rs (#2120's scope), no snapshot-gate files (#2119), no packages/skill/SKILL.md (unrelated CLI-facing doc, confirmed by content — --property key=value flags, not the LLM tool schema). Cross-checked #2120/#2119's issue bodies directly: #2120 does list tools.rs/skill_pipeline.rs in its scope, but #2123 is explicitly documented as a prerequisite defect for that work ("a golden authored against a properties parameter is authoring text the model provably cannot see"), so the overlap is expected and non-conflicting, not scope creep.

Verification performed independently of the PR's own report: checked out the branch in an isolated git worktree, cargo check -p nodespace-agent -p nodespace-daemon --tests clean, cargo test -p nodespace-agent → 491 passed/0 failed/1 ignored, cargo test -p nodespace-daemon → 148 passed/0 failed, cargo fmt --check clean, cargo clippy --all-targets (both packages) clean — all matching the PR's reported numbers.

Minor, non-blocking observations:

  • Edge case (item 5): since AgentCreateNodeParams/AgentUpdateNodeParams are deliberately not deny_unknown_fields, a call that still sent the old "properties" wrapper key (e.g. a stray/legacy caller) wouldn't be rejected — it would fall through the flat-extras KNOWN-list scan (which doesn't include "properties") and get silently promoted as a top-level property literally named "properties" holding the whole nested object, rather than being flattened correctly or failing loudly. Given this repo's explicit no-backward-compat/greenfield policy this is an acceptable consequence of the design, not a defect — flagging only so it's a known shape rather than a surprise if it ever shows up in a trace.
  • Nit: def_update_node's tool description still contains the generic English phrase "update an existing node's content or properties immediately" (concept-level word, not the quoted parameter name, which is correctly "field_values" everywhere it's instructive). Harmless, but could be tightened since the whole point of this PR is to stop the model from associating the word "properties" with this tool's argument shape.

No blocking issues found. Nice work — the regression test's reverted-code verification in particular is a good sign this doesn't just look right, it demonstrably catches the bug it's meant to catch.

…scription

Review nit on #2144: def_update_node's description still said "content
or properties" in prose. Not a wire-key reference (the quoted parameter
name is already field_values throughout), but the whole point of this
rename is to stop the model associating that word with this tool's
argument shape, so tighten it to match.
@mstomar125

Copy link
Copy Markdown
Contributor Author

Self-verification complete (GitHub blocks self-review approval, so noting here instead): adversarial re-review above returned APPROVE with no blocking issues. Independently confirmed: golden-runner probe reproduces the fix against the locked model (420→592 chars, allowed_values now present), live scenario6_update_node_properties test gets the correct field_values write 3/3 trials against the real production schema, full workspace test suite (cargo test --workspace --exclude nodespace-app) + clippy --all-targets + fmt --check all clean, and the pre-push gate (frontend + Rust, cargo build --bin nodespaced included) passed on both commits. Proceeding to merge.

@mstomar125
mstomar125 merged commit a074343 into main Aug 18, 2026
@mstomar125
mstomar125 deleted the issue-2123-properties-param-collision branch August 18, 2026 11:58
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.

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

1 participant