Repository navigation
Rename create_node/update_node's properties parameter to field_values - #2144
Conversation
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.
APPROVEReviewed 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 2. Diff correctness. 3. Test coverage. Verified 4. Scope discipline. File list is exactly the 8 files described — no Verification performed independently of the PR's own report: checked out the branch in an isolated git worktree, Minor, non-blocking observations:
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.
|
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. |
Summary
A tool parameter named exactly
propertiesoncreate_node/update_nodecollides with JSON Schema's ownpropertieskeyword 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-tunedallowed_valuesrule and thecustom:-prefix rule from ADR-063 — before the model ever sees it.This renames the wire parameter on both tools from
propertiestofield_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:1266passest.parameters_schemathrough 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 thepropertieskey tofield_valuesin bothdef_create_node()'s anddef_update_node()'sparameters_schema, renamed theAgentCreateNodeParams/AgentUpdateNodeParamsstruct fields and their flat-extrasKNOWNpromotion lists, and updated the tool descriptions and error messages that referenced the old wire name.packages/agent/src/local_agent/agent_loop.rs: updatedrepair_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 referencefield_valuesinstead ofproperties.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 viaargs.get("properties"). Updated toargs.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.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 realToolExecutionRecords throughcompleted_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
propertiesdata field (as returned byget_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, andgolden_scenario6_real_pipeline.rs's hand-authoredupdate_nodetool) that are explicitly documented as deliberately-minimal, hand-authored schemas independent of production (resolve_query/create_node/update_nodere-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 nativegemma-4-E4B-it-Q4_K_M.gguf:allowed_valuesguidance reaches the modelproperties(before)field_values(after)Live end-to-end regression —
scenario6_update_node_properties::update_node_after_resolve_carries_the_changed_property, which drives the REAL productionupdate_nodetool definition against the locked model reproducing issue #1927's exact scenario:3/3 trials now correctly carry the requested state change — previously invisible because it lived under the colliding
propertieskey.Also ran
live_update_node_noop_gatelive: 3/3 reps persisted the requested state change viafield_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 failedcargo test --workspace --exclude nodespace-app— all greencargo clippy --all-targets— cleancargo fmt --check— cleanallowed_valuesnow present)scenario6_update_node_propertiestest: 3/3 trials correctly carry the state changelive_update_node_noop_gatetest: 3/3 reps persist correctlybun run test:all(frontend + Rust, pre-push gate) — passed🤖 Generated with Claude Code