Skip to content

Serialize BSH thinking summaries with the Assistant role, not System #439

Closed

Description

@gaobrian

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 system or developer message.
  • When the summary is sent as conversation context, serialize it as an assistant message: 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 tool message.
  • Do not serialize it as user or tool: 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 a system or developer message.
  • 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.

Activity

  1. changed the title [-]Fix thinking-summary injection: keep prior reasoning summaries out of System messages[/-] [+]Serialize BSH thinking summaries with the Assistant role, not System[/+] on Nov 18, 2026
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