Skip to content

feat: detect and repair inline stop-hook progress resume issue#234

Open
danshapiro wants to merge 7 commits intomainfrom
inline-progress-session-repair
Open

feat: detect and repair inline stop-hook progress resume issue#234
danshapiro wants to merge 7 commits intomainfrom
inline-progress-session-repair

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • Extended session scanner to classify the inline stop-hook progress chain shape (assistant -> progress(hook_progress/Stop) -> stop_hook_summary -> turn_duration?) as resumeIssue: 'inline_stop_hook_progress' while keeping the session status: 'healthy'
  • Added targeted repair that rewrites only stop_hook_summary.parentUuid to bypass the progress record, leaving it as a preserved side leaf
  • Gated the repair to active resume paths only — disk/background scans classify but never rewrite
  • Service layer re-enqueues cached resume-issue results at active priority before returning to terminal.create

Test plan

  • Scanner classification tests (inline + sibling control fixtures): all pass
  • Repair tests (idempotency, content preservation, backup creation, opt-in gating): all pass
  • Queue tests (disk vs active priority, cache bypass, clearProcessed): all pass
  • Integration tests (ws-handler session repair flow): all pass
  • npm run typecheck: zero errors
  • Pre-existing failures in turnCompletionSlice.test.ts and terminal-registry.test.ts MCP injection tests (also fail on main)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Dan Shapiro and others added 7 commits March 27, 2026 16:21
… plan

1. repair() builds ParsedMessage inline without the new fields (subtype,
   toolUseID, dataType, dataHookEvent), so detectInlineStopHookProgress
   would always return undefined inside repair(). Added explicit step to
   update the inline construction.

2. Service waitForSession() calls queue.enqueue() then queue.waitFor(),
   but waitFor() checks this.processed first and returns the stale
   resume-issue result immediately. Added clearProcessed() method to queue
   and clearProcessed calls before each enqueue+waitFor sequence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 778290f39b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +160 to +163
if (existing.resumeIssue) {
this.queue.clearProcessed(sessionId)
this.queue.enqueue([{ sessionId, filePath: existing.filePath, priority: 'active' }])
return this.queue.waitFor(sessionId, timeoutMs)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Upgrade queued resume-issue sessions to active priority

This requeue path only handles sessions that already have a processed/cached result, but waitForSession still returns early for sessions that are merely queued (this.queue.has(sessionId)) without promoting their priority. That means a session discovered at startup with priority: 'disk' can be awaited as-is, scanned without resume-issue repair, and returned as healthy with resumeIssue still present, so terminal.create can continue with a broken --resume despite this method being the active-resume guard.

Useful? React with 👍 / 👎.

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.

1 participant