Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

feat(agent): Sync claude adapter with upstream v0.44.0 - #2593

Merged
charlesvien merged 3 commits into
mainfrom
06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0
Jun 11, 2026
Merged

feat(agent): Sync claude adapter with upstream v0.44.0#2593
charlesvien merged 3 commits into
mainfrom
06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0

Conversation

@charlesvien

@charlesviencharlesvien commented Jun 11, 2026

Copy link
Copy Markdown
Member

Problem

The claude adapter fork is behind upstream v0.44.0, most notably missing the fix for assistant text being lost behind gateways that return a turn as a single non-streamed block.

Changes

  1. Bump claude-agent-sdk to 0.3.170 and anthropic SDK to 0.104.1
  2. Forward un-streamed assistant text/thinking blocks via per-turn streamed-block tracker
  3. No-op the new fallback content block instead of tripping unreachable
  4. Stub the new usage_EXPERIMENTAL Query method in the SDK test mock
  5. Skip upstream's elicitation feature (conflicts with AskUserQuestion divergence)
  6. Update UPSTREAM.md with v0.44.0 ported/skipped notes

How did you test this?

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@charlesvienGraphite App

charlesvien commented Jun 11, 2026

Copy link
Copy Markdown
MemberAuthor

@github-actions

github-actionsBot commented Jun 11, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 78f207b.

@greptile-apps

greptile-appsBot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

T-Rex T-Rex Logs

What T-Rex did

  • Generated focused edge-case checks for the Claude ACP conversion of streamed and assembled assistant blocks.
  • Exercised edge-case scenarios including assembled text without deltas, duplicate streamed text, mixed text/thinking streaming, missing message_start, subagent deltas, multiple message IDs, empty IDs, and the new fallback block type.
  • The focused checks passed, and the existing conversion tests also passed.
  • No dropped or duplicated assistant content was reproduced in those conversion paths.
  • Created sdk-to-acp-edge.test.ts with 12 targeted tests exercising the hypothesis edge cases.
  • Ran pnpm vitest run in packages/agent; all 12 tests passed (exit 0).
  • Confirmed existing 15 tests in sdk-to-acp.test.ts also passed.
  • No content is dropped or duplicated in any tested scenario.
  • The fallback content block type (SDK 0.3.170) is handled by the existing case in processContentChunk, with no crash.
  • Empty message id ("") correctly becomes undefined via || undefined, preventing false matches in streamed ID sets.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. packages/agent/src/adapters/claude/claude-agent.ts, line 994 (link)

    P1Handle fallback retractions

    SDK 0.3.170 assistant messages can now include supersedes for refusal fallback replacement, and the matching model_refusal_fallback system message can carry retracted_message_uuids. Those fields mean previously delivered refused chunks or tombstoned tool results should be evicted. This path renders the replacement assistant message, but nothing in the prompt loop or handleSystemMessage removes the retracted messages, so a refusal fallback can leave stale refused content visible in the transcript or persisted session log alongside the canonical fallback answer.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/agent/src/adapters/claude/claude-agent.ts
    Line: 994
    Comment:
    **Handle fallback retractions**
    SDK 0.3.170 assistant messages can now include `supersedes` for refusal fallback replacement, and the matching `model_refusal_fallback` system message can carry `retracted_message_uuids`. Those fields mean previously delivered refused chunks or tombstoned tool results should be evicted. This path renders the replacement assistant message, but nothing in the prompt loop or `handleSystemMessage` removes the retracted messages, so a refusal fallback can leave stale refused content visible in the transcript or persisted session log alongside the canonical fallback answer.
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---### Issue 1 of 1
packages/agent/src/adapters/claude/claude-agent.ts:994
**Handle fallback retractions**
SDK 0.3.170 assistant messages can now include `supersedes` for refusal fallback replacement, and the matching `model_refusal_fallback` system message can carry `retracted_message_uuids`. Those fields mean previously delivered refused chunks or tombstoned tool results should be evicted. This path renders the replacement assistant message, but nothing in the prompt loop or `handleSystemMessage` removes the retracted messages, so a refusal fallback can leave stale refused content visible in the transcript or persisted session log alongside the canonical fallback answer.

Reviews (1): Last reviewed commit: "feat(agent): Sync claude adapter with up..." | Re-trigger Greptile

@charlesvien
charlesvienforce-pushed the 06-06-add-crash-telemetry branch from 98b3e03 to b843675CompareJune 11, 2026 08:08
@charlesvien
charlesvienforce-pushed the 06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0 branch from b815015 to 1430655CompareJune 11, 2026 08:08
@charlesvien
charlesvien changed the base branch from 06-06-add-crash-telemetry to graphite-base/2593June 11, 2026 08:47
@charlesvien
charlesvienforce-pushed the 06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0 branch from 1430655 to 0cefecfCompareJune 11, 2026 09:03
@graphite-app
graphite-appBot changed the base branch from graphite-base/2593 to mainJune 11, 2026 09:04
@charlesvien
charlesvienforce-pushed the 06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0 branch from 0cefecf to 78f207bCompareJune 11, 2026 09:04
@charlesvien
charlesvien merged commit db3f9d3 into mainJun 11, 2026
24 checks passed
@charlesvienGraphite App

Copy link
Copy Markdown
MemberAuthor

Merge activity

@charlesvien
charlesvien deleted the 06-11-feat_agent_sync_claude_adapter_with_upstream_v0.44.0 branch June 11, 2026 09:13
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@charlesvien@tatoalo