t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Quoting an assistant message that came from a thinking block triggers the reasoning_extraction safeguard

Open LaganYT opened this issue 1 month ago • 3 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate. (#23881 is about context handoff after an interrupt; a comment there reports the same error from quoting, which this issue covers.)
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Use the Claude provider with a Claude 5.1+ model (seen with Sonnet 5.5) in a thread that has a delegated subagent thread.
  2. In the subagent thread, find an assistant message the model wrote as a thinking block before a tool call. These show up as normal assistant messages, and their ids end in :thinking:<n>.
  3. Select some of its text, use the quote popup, add a comment, and send.

Expected behavior

The follow-up is answered, or the UI doesn't offer a quote that can't be sent.

Actual behavior

The turn fails with API Error: Sonnet 5.5's safeguards flagged this message ... Details: [reasoning_extraction].

The quote link carries the selected text into the prompt, so the model's own thinking is sent back to it. I couldn't reproduce the safeguard here, so this is the likely cause rather than a confirmed one. The message ids and error line up, and the comment on #23881 describes the same thing with a thinking:1 item.

Impact

Major degradation or frequent failure

Version or commit

Unknown (checked against main at fe219c4de1)

Environment

macOS, T3 Code desktop, Claude provider, claude-sonnet-5-5

Logs or stack traces

API Error: Sonnet 5.5's safeguards flagged this message (https://www.anthropic.com/legal/aup).
Details: [reasoning_extraction]
Request ID: req_011CgVmgZoNVdqfsAttsRNbD

Workaround

Quote a normal reply instead, or type the comment without a quote.

LaganYT avatar Oct 29 '26 03:10 LaganYT

claude-opus-5-5 responding on behalf of project516

Confirming this on a second setup, with log evidence that the quoted thinking item is what trips the safeguard.

Environment

  • Server: T3 Code 0.1.5 (6d450a42) on Linux arm64, Node 26
  • Clients: web app (app.t3.codes, Chrome on macOS) and the desktop app, both against that server
  • Provider: Claude, claude-opus-5-5

Evidence from the provider event log

  • The outgoing user message has one [Assistant quote](t3-citation://v1/...) link. Its message id ends in :thinking:1. It has no <assistant_citations> block, so #16327 applies here too.
  • The next event from Claude has stop_reason: "refusal". The UI shows Opus 5.5's safeguards flagged this message ... Details: [reasoning_extraction].
  • In the same log, a later reply quoting a different :thinking:1 item went through, and a reply quoting a normal assistant message went through. So the failure is intermittent, but each failure we found followed a quote of a thinking item.

#26790 looks like it would fix this. It is still open, so 0.1.6 nightlies still have the bug.

Workaround: quote final replies only, not the short notes written before tool calls.

Project516 avatar Oct 30 '26 23:10 Project516

claude-opus-5-5 responding on behalf of project516

Opened #27934 for this. It takes a different route from #26790 and needs a maintainer call on one trade-off.

Every other provider shows reasoning as a Thought row with no quote action. Claude 5.1+ is the exception: since #18364, a thinking block before a tool call shows as a normal reply, so it gets the quote action. #27934 removes the quote action from those replies only. The text still shows, and normal Claude replies can still be quoted.

The trade-off: users can no longer quote these notes. #26790 kept the quote and silently dropped the quoted text from the prompt. That keeps the action, but the model would not see what the user thinks they sent.

Is removing the quote action on these notes the direction you want?

Evidence is in the PR. I did not trigger a refusal on purpose. In my logs, 1 of 6 prompts that quoted a thinking-derived reply was refused with reasoning_extraction, and none of 43 prompts that quoted normal replies were.

Project516 avatar Oct 31 '26 01:10 Project516

Same here (T3 Code beta, Claude provider, Opus 5.5). Quoting a status line from the assistant's thinking block (citation id ends in :thinking:1) as a steer message got the turn blocked with [reasoning_extraction]. Because the quoted text stays in the thread history, every retry in that thread hits the same block, so a long thread (~870 messages) is effectively dead and has to be moved to a new thread.

Suggestion: don't offer the "quote" action on thinking-block text, or send only the user's comment and drop the quoted thinking text from the provider payload.

jndegens avatar Nov 18 '26 00:11 jndegens