Skip to content

fix: persist Claude session id and stabilize output aggregation#1

Closed
ZhangYiqun018 wants to merge 1 commit into13rac1:mainfrom
ZhangYiqun018:fix/session-resume-output-stability
Closed

fix: persist Claude session id and stabilize output aggregation#1
ZhangYiqun018 wants to merge 1 commit into13rac1:mainfrom
ZhangYiqun018:fix/session-resume-output-stability

Conversation

@ZhangYiqun018
Copy link
Copy Markdown
Contributor

@ZhangYiqun018 ZhangYiqun018 commented Mar 5, 2026

Summary

This PR fixes multi-turn continuity and output stability issues in the Claude Code plugin.

Changes

  • Persist Claude session_id from stream events into session metadata (claudeSessionId)
  • Reuse persisted claudeSessionId for subsequent --resume runs
  • Remove duplicate output append path in claude_code_status when container has already exited
  • Prefer canonical final text (assistant/result) at job completion to stabilize final output

Why

We observed intermittent output duplication/reordering and unreliable multi-turn resume behavior.

Validation

  • Reproduced prior issues with repeated runs
  • Verified after patch:
    • multi-turn recall works across jobs in the same session_id
    • final output is stable for known repro prompts

Notes

No secrets or user credentials are included in this change.

Repository owner deleted a comment from codecov-commenter Mar 26, 2026
13rac1 added a commit that referenced this pull request Mar 28, 2026
…rite

Refactor the cherry-picked PR #1 changes:
- Extract parseSessionId() into stream-parser.ts alongside existing parsers
- Remove tryCaptureFinalText closure and fs.writeFile overwrite that
  destroyed incremental output
- Add 8 tests for parseSessionId and updateSession behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@13rac1
Copy link
Copy Markdown
Owner

13rac1 commented Apr 3, 2026

Replaced by #3 Thank you!

@13rac1 13rac1 closed this Apr 3, 2026
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