Skip to content

Creating a task is refused for undeclared field keys, sometimes on every call, and the routing eval passes it #3603

Closed

Description

@malibio

Overview

Asked to create a task, the local agent's first create_node call is refused for a field key the task type does not declare, and in one routing-eval scenario every call is refused and no task is created. eval:routing scores those turns as passes, because it checks that create_node was called, not that a record exists afterwards.

Measured on gemma-4-e4b-q4km, isolated daemon, on main at 99393eca and on the branch for #3533. The two builds make identical calls on these requests from an empty database, so this predates #3533 and is not changed by it.

Problem Statement

1. create_node for a task is sent undeclared field keys

From an empty database, identical on both builds:

  • "Create a new task called 'Review the sync protocol spec'" (direct-node-create). Routed skills: Schema Creation 0.912, Node Creation 0.907, Conflict Journal 0.872.
    • Call 1: {"content":"Review the sync protocol spec","field_values":{"task__status":"open"},"node_type":"task"} → 'task__status' is not a field of the core type 'task'. A core type takes only its declared fields; to add your own, use a namespace prefix (e.g. 'custom:task__status').
    • Call 2: field_values: {"custom": []} → 'custom' is not a field of the core type 'task'. ... (e.g. 'custom:custom')
    • Call 3: field_values: {} → created, with no fields.
  • "Add a task to rotate the staging API keys, and also pull up my notes on the auth redesign" (multi-task-and-search). Routed skills: Play Authoring 0.832, Node Creation 0.818, Graph Editing 0.811.
    • Call 1: field_values: {"task__status":"open"} → refused as above. No further create_node, and no task is created. Once the fixture's earlier scenarios have created their types, a second call follows, {"content":"Rotate staging API keys","field_values":{"custom":true}}, refused for the missing node_type.

In both, Node Creation is a candidate and does not lead, so create_node is offered without its declared fields: those come only from the candidates at the turn's top score (routing::declare_write_tool_fields). The second call in each follows the refusal's own example (custom:...) into another invalid key.

2. With custom types in the workspace, a task with details is never created

"Create a task to move the notifications service onto the new queue tomorrow morning, make it high priority, and note on it that the old queue shuts down at noon on Friday" (single-intent-long-task). Routed skills: Node Creation 0.848, Graph Editing 0.843, Schema Creation 0.820, so Node Creation leads.

  • From an empty database: one call, field_values: {"priority":"high"} with the note folded into the content, created.
  • After the fixture's earlier scenarios have created their types (four reps on the Two plain requests end with nothing created: an add whose noun sounds like another skill, and a bare 'start tracking'; the routing eval passes the second #3533 branch, each ending in three refused calls; the arguments below are from one of them):
    • Call 1: field_values: {"notes":"Old queue shuts down at noon on Friday.","priority":"high"} → 'notes' is not a field of the core type 'task'. ... (e.g. 'custom:notes')
    • Call 2: {"content":"Move notifications service onto the new queue","field_values":{"custom":2031105896}} → missing field node_type
    • Call 3: arguments that do not parse as intended ("priority":"high\,custom:2031105896},node_type:") → missing field node_type`
    • No task exists afterwards.

This state was not run on main. The candidates and scores are the same on both builds.

3. The routing eval cannot see it

All three scenarios pass in every rep, including the one where nothing was created. The fixture confirms Node Creation from the reply or from create_node appearing in the tools called. #3533 closes the same gap for type creation (createsType, scored on a create_schema call the tool accepted); record creation is scored the old way.

Proposed Solution

Each part needs its own measurement; none has a known fix.

  • Parts 1 and 2. Decide which layer owns it per ADR-064, then measure. Candidates: whether create_node should carry a core type's declared fields whenever the call can name that type, not only when a skill holding it leads; what the refusal says (its custom:<key> example is what the second call copies, and ADR-064 records an informative repair error failing before); and whether a field the type does not declare should be refused at all or reported as not stored. The refusal's custom: example is generated in core and shared with the CLI.
  • Part 3. Score the routing fixture's record-creating scenarios on a create_node call the tool accepted, the way createsType scores type creation, and report in a 3-rep run which of them were passing on refused calls.

Documentation

  • ADR-064 rule 1 - tool schemas own argument shape, which decides where a fix for undeclared keys belongs
  • ADR-064 rule 4 - tool results own facts, not procedures, which bounds what the refusal may say; its 2026-10-05 amendment records a refusal the model could not act on
  • ADR-038 - declared fields on a write tool come from the candidates at the turn's top score
  • Agent evals - the routing layer, createsType, winnability, and how to run a partial fixture
  • Updates: agent-eval.md when the routing fixture scores record creation on the record

Architecture Impact

No ADR is reversed. If the fix declares a core type's fields on create_node from a candidate that does not lead, that changes the rule routing::declare_write_tool_fields documents (the distractor case it protects is recorded there) and needs an amendment to ADR-038, written first.

Acceptance Criteria

  • "Create a new task called 'Review the sync protocol spec'" from an empty database creates the task on its first create_node call in 3 of 3 reps
  • The task request in multi-task-and-search creates a task in 3 of 3 reps
  • single-intent-long-task creates one task in 3 of 3 reps, from an empty database and after the fixture's type-creating scenarios have run
  • A create_node refused for an undeclared field is followed by a call that can succeed, not by one that copies the refusal's example into another invalid key
  • eval:routing's record-creating scenarios fail when no create_node call was accepted, and a 3-rep run reports which of them were passing on refused calls before the change
  • The distractor case declare_write_tool_fields protects (a turn offering create_node beside create_schema) still passes its pinning tests
  • Code passes bun run quality:fix and bun run test:changed

Technical Specifications

Reference Files

  • Declared fields on write tools: packages/agent/src/local_agent/routing.rs - declare_write_tool_fields, top_tool_bearing_score
  • create_node definition and declared field_values: packages/agent/src/local_agent/tools.rs - def_create_node, with_declared_field_values
  • The refusal: packages/core/src - search for "is not a field of the core type"
  • Node Creation guidance: packages/agent/src/seeds/skills/node-creation.md, packages/agent/src/skill_rules.rs
  • Routing fixture: scripts/eval/fixtures/routing.ts - createsType, createdAType, assertRouting; scripts/eval/fixtures/routing.test.ts

Reproducing

Isolate the daemon with NODESPACE_HOME (see "Setup" in agent-eval.md), load gemma-4-e4b-q4km, then:

bun run eval:routing e4b out.json --only direct-node-create,multi-task-and-search,single-intent-long-task

That runs the three from an empty database. For part 2's failing state, run the full fixture, which reaches single-intent-long-task after the type-creating scenarios. Tool arguments and error text are in the daemon log's Tool executed lines at RUST_LOG=debug.

Related Issues

Non-Goals

  • Changing which skill leads these requests
  • The routing fixture's type-creating scenarios

Activity

  1. added
    bug
    on Oct 5, 2026
  2. malibio commented on Oct 5, 2026

    @malibio
    CollaboratorAuthor

    Baseline before work (shared branch issue-3603-3632-create-shapes) — Frontend: 322 files, 5875 tests passed

  3. self-assigned this
    on Oct 5, 2026
  4. added a commit that references this issue on Oct 6, 2026
    6fd13ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-agentsbugnlp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions