Skip to content

Audit all agent-facing parameter structs for silent unknown-field discard #1816

Closed

Description

@malibio

Overview

Generalize the coreValues fix. Any agent-facing deserialization target without deny_unknown_fields turns a model typo into silent data loss plus a misleading downstream error.

Problem Statement

The coreValues casing bug cost a full spike investigation to localize, purely because the failure surfaced two layers from its cause: the key was dropped silently, then validation failed with a message about a different thing.

Every Deserialize struct reachable from a tool call has this property. With a small local model that will occasionally misspell a key, silent discard is the wrong default everywhere.

Evidence

  • grep -rn "deny_unknown_fields" packages/agent/src packages/core/src returns zero hits across both crates
  • packages/core/src/schema/mod.rs:139 CreateSchemaParams and :167 AdditionalConstraints — neither sets it
  • The coreValues incident: prose taught the wrong casing, the key was discarded without error, and validation reported "enum has no values"

Acceptance Criteria

  • Every struct deserialized from tool-call arguments carries deny_unknown_fields
  • Rejection errors name the offending field and list the accepted fields, so the model can self-correct from the error text
  • A test per tool asserts an unknown argument is rejected rather than ignored

Architecture Impact

Converts a silent-corruption class into a loud-failure class. An informative rejection also doubles as a repair signal the model can act on — consistent with ADR-064 rule 4, where tool results carry facts the model can use rather than prose it must interpret.

Depends on the coreValues fix landing the pattern first.

Activity

  1. malibio commented on Jul 30, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 171 test files passed, 4112 tests passed.

  2. self-assigned this
    on Jul 30, 2026
  3. added a commit that references this issue on Jul 30, 2026
    08c3779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions