Skip to content

feat: add stop_reason field to ResultMessage#619

Merged
qing-ant merged 1 commit into
mainfrom
qing/add-stop-reason
Mar 3, 2026
Merged

feat: add stop_reason field to ResultMessage#619
qing-ant merged 1 commit into
mainfrom
qing/add-stop-reason

Conversation

@qing-ant
Copy link
Copy Markdown
Contributor

@qing-ant qing-ant commented Mar 2, 2026

Adds stop_reason: str | None to ResultMessage, matching the TypeScript SDK.

The field carries the API's stop reason ("end_turn", "max_tokens", etc.) through to the result message. Backward-compatible: defaults to None and the parser uses data.get("stop_reason"), so older CLI output without the field produces None rather than failing.

  • Add stop_reason: str | None field to ResultMessage

Test plan

  • Unit: parser tests for explicit value, explicit nullNone, and absent field → None
  • E2E: verified against CLI v2.1.64-dev — SDK parsing correct (CLI-side population tracked separately)

@qing-ant qing-ant enabled auto-merge (squash) March 3, 2026 01:04
@qing-ant qing-ant requested a review from dltn March 3, 2026 03:56
@qing-ant qing-ant merged commit 7219299 into main Mar 3, 2026
9 checks passed
@qing-ant qing-ant deleted the qing/add-stop-reason branch March 3, 2026 18:20
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.

2 participants