Skip to content

fix(interface): a turn prompt is bounded as metadata at 16 KiB, so a large brief cannot be sent #313

Description

@drewstone

Summary

AgentTurnInput.prompt is boundedStringSchemaCONTRACT_MAX_STRING_LENGTH, 16,384 characters. That is the metadata bound. A prompt is not metadata: it is the content of the turn, the same category as the response text and the tool output that were both moved to the content bound in #311 and #312.

The result is that a manager cannot hand a worker a brief longer than 16 KiB. A brief that quotes a paper, embeds a patch, or carries a page of prior evidence is refused at the adapter boundary.

Observed

Measured 2026-09-11 in a live Discovery Lab run (zkp-frontier-20260911d) on agent-provider-tangle 1.1.10 and agent-runtime 0.214.0 — i.e. with both prior bound fixes already in:

retained provider execution requires reconciliation before replacement: caused by ZodError: [
  {
    "origin": "string",
    "code": "too_big",
    "maximum": 16384,
    "inclusive": true,
    "path": [ "prompt" ],
    "message": "Too big: expected string to have <=16384 characters"
  }
]

2 of that run's 10 child deaths. The director was transferring a 27 KB patch to an independent-checker child so it could rebuild and re-verify a measured result; the transfer could not be expressed as a prompt.

Where

  • packages/agent-interface/src/environment-runtime.ts:58prompt: boundedStringSchema.optional()
  • also runtime-control.ts:402, portable-context-continuation.ts:81, environment-interactive-control.ts:549

boundedStringSchema is CONTRACT_MAX_STRING_LENGTH (16,384). boundedEventContentStringSchema already exists for exactly this kind of value and is bounded at CONTRACT_MAX_JSON_BYTES (1 MiB).

Why this is the same class as #311 and #312

Three times now, agent-authored content has been held to the bound written for identifiers and accounting fields:

field was now
#311 toolInvocations[].result 16 KiB metadata content
#312 same, on throw-vs-truncate discarded a paid turn truncated
this prompt 16 KiB metadata ?

The distinguishing test is simple and worth stating once in the contract: if an agent or a tool produced it, it is content; if it names, routes, or accounts for the turn, it is metadata. A prompt is produced for the agent, and its size is set by the work, not by the protocol.

Note on severity

Unlike #312 this one fails before the turn runs, so it does not discard paid work. It refuses the turn outright, which is the honest failure — but it silently caps what a manager can delegate, and the ceiling is invisible until a brief crosses it.

Suggested change

Move prompt to boundedEventContentStringSchema at the four sites above. Truncation is not appropriate here (a silently shortened instruction is worse than a refusal), so the refusal stays — it just moves to 1 MiB, where the producer's own limits already sit.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions