Skip to content

Log the feedback a model drafts about its own turn - #13

Merged
mipsel64 merged 1 commit into
mainfrom
block-client-tools
Sep 14, 2026
Merged

mipsel64 merged 1 commit into
mainfrom
block-client-tools

Conversation

@mipsel64

@mipsel64 mipsel64 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Claude Code's SendFeedback tool drafts a bug report when it judges that a turn
went wrong, and a model behind tinyllm fires it at its own mistakes. Those drafts
are also a bug report about tinyllm — a model saying it misread a request may be
describing something the translation dropped: a message part, a tool result,
reasoning lost across a continuation. They were queued in the client and never
reached the operator running the gateway.

Changes

  • RequestBody::drafted_feedback reads the tool call out of the request that
    carries it; endpoint::run logs the full input at warn with the model and
    request ID.
  • It inspects only the last exchange: an assistant message holding a
    SendFeedback tool_use, followed by the user message with its results. That
    matches exactly one request per draft, so a stateless gateway reports each once
    instead of re-logging it every turn as the history grows.
  • Documented in README.md. No new configuration.

Why not block the tool

Stripping the definition from the forwarded tool list would stop the drafts, but
it would also stop the signal, and the call is a noop for the session: the draft
is queued in the client, which is why it never interrupts the conversation.

Swallowing the tool_use in the outbound response would silence it without
losing the log, but dropping a call that was the model's only action ends the
turn early and stops work mid-task — and a stream cannot tell that in advance
without buffering.

Testing

drafted_feedback_is_read_from_the_turn_that_just_completed covers the carrying
request, including a draft batched with another tool call, and the six shapes
that must stay silent — among them the same draft further back in the history.
Full suite: 112 passed, clippy clean.

@mipsel64 mipsel64 changed the title Strip blocked client tools before they reach the provider Strip blocked client tools, and log the feedback a model drafts Sep 14, 2026
@mipsel64 mipsel64 changed the title Strip blocked client tools, and log the feedback a model drafts Log the feedback a model drafts about its own turn Sep 14, 2026
Claude Code's SendFeedback tool drafts a bug report when it judges that a turn
went wrong, and a model behind tinyllm fires it at its own mistakes. Those
drafts are also a bug report about tinyllm: a model saying it misread a request
may be describing something the translation dropped - a message part, a tool
result, reasoning lost across a continuation. They were queued in the client and
never reached the operator running the gateway.

`RequestBody::drafted_feedback` reads the tool call out of the request that
carries it and `endpoint::run` logs the whole input at warn, next to the model
and request ID. It inspects only the last exchange: an assistant message holding
a SendFeedback tool_use, followed by the user message with its results. That is
true of exactly one request per draft, so a stateless gateway reports each once
instead of re-logging it every turn as the history grows.

The tool itself is forwarded untouched. Stripping the definition would stop the
drafts, but it would also stop the signal, and the call is a noop for the
session: the draft is queued in the client, which is why it never interrupts the
conversation. Swallowing the tool_use in the response would silence it without
losing the log, but dropping a call that was the model's only action ends the
turn early and stops work mid-task.
@mipsel64
mipsel64 merged commit dc47c34 into main Sep 14, 2026
4 checks passed
@mipsel64
mipsel64 deleted the block-client-tools branch September 14, 2026 06:00
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.

1 participant