Skip to content

fix(server): keep rejected Claude prompts out of running turns - #740

Merged
rynfar merged 1 commit into
pylonfrom
fix/claude-stream-stalls-20260924
Sep 24, 2026
Merged

rynfar merged 1 commit into
pylonfrom
fix/claude-stream-stalls-20260924

Conversation

@rynfar

@rynfar rynfar commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

An unreadable Claude image attachment could fail sendTurn after the adapter had already emitted turn.started and marked the session running. No prompt reached the SDK, so the thread appeared to wait indefinitely and a later message was steered into that empty turn.

Prepare the prompt before changing turn or recovery state, and recheck session ownership after asynchronous preparation and provider setup. This keeps rejected sends out of the runtime queue and rejects sends that finish after a session stop. Regression tests cover missing attachments and stop during provider setup.

Validation: vp test run apps/server/src/provider/Layers/ClaudeAdapter.test.ts (176 passed); vp lint apps/server/src/provider/Layers/ClaudeAdapter.ts apps/server/src/provider/Layers/ClaudeAdapter.test.ts; vp run -F t3 typecheck.

Built with GPT-6 Sol low in the Codex harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pylon-marketing Ignored Ignored Preview Sep 24, 2026 7:28am UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 13.9 KiB −20 B (−0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +3 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.8 KiB 6.7 KiB −23 B (−0.3%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB −8 B (−0.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +4 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB −12 B (−0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 3868597 · PR result: dc772e5 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 115.6 KiB
  • Claude decoded thread snapshot: 116.3 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit eab374a into pylon Sep 24, 2026
19 checks passed
@rynfar
rynfar deleted the fix/claude-stream-stalls-20260924 branch September 24, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant