Repository navigation
Closed
Description
Problem
The inspected request body embeds a BSH [thinking-summary] block inside a role: system message. The block is a compacted continuation summary of the assistant's prior reasoning and observed tool results; it is not system policy, developer policy, a user message, or a tool response.
The role must describe the semantic source of the message. Using system misclassifies assistant continuation state as highest-priority instruction.
Requirements
- Do not serialize the BSH thinking summary inside a
systemordevelopermessage. - When the summary is sent as conversation context, serialize it as an
assistantmessage: it represents the assistant's own prior task state/continuation summary. - Keep the summary distinguishable from ordinary user-facing assistant output through an internal message kind/metadata if the current model abstraction needs that distinction; do not invent a provider-visible role unsupported by the target API.
- Preserve provenance and epistemic status (for example, inferred versus confirmed). A summary of a tool result is not itself a
toolmessage. - Do not serialize it as
userortool: it was not authored by the user and is not a direct tool response associated with a tool call ID. - Keep provider-native reasoning payload/state separate. Do not convert hidden/native reasoning into ordinary assistant text or expose hidden chain-of-thought; only send the bounded, deliberately generated continuation summary.
- If the summary is not needed in the next request, retain it only in orchestration state and omit it from messages.
Acceptance criteria
- No
[thinking-summary]block is serialized in asystemordevelopermessage. - When serialized, its provider-facing role is
assistant. - Any internal summary marker/metadata is not emitted as an unsupported provider role.
- Inferred facts remain distinguishable from tool-confirmed facts.
- Request-body tests cover summary-present and summary-absent cases and assert exact roles and ordering.
- Existing assistant tool-call / tool-result sequencing remains valid; summary content is not mislabeled as a tool response.
Scope
Only fix the BSH-generated continuation summary's role and lifecycle. Provider-native reasoning serialization/round-tripping is separate.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Fix thinking-summary injection: keep prior reasoning summaries out of System messages[/-][+]Serialize BSH thinking summaries with the Assistant role, not System[/+]react: move thinking summaries and memory out of system messages (#439,