Skip to content

fix(autopilot): pass sessionId to generateContinuationPrompt on failed transition#2182

Open
jonckr wants to merge 1 commit intoYeachan-Heo:devfrom
jonckr:fix/autopilot-continuation-sessionid
Open

fix(autopilot): pass sessionId to generateContinuationPrompt on failed transition#2182
jonckr wants to merge 1 commit intoYeachan-Heo:devfrom
jonckr:fix/autopilot-continuation-sessionid

Conversation

@jonckr
Copy link
Copy Markdown

@jonckr jonckr commented Apr 5, 2026

Problem

In src/hooks/autopilot/enforcement.ts line 276, generateContinuationPrompt(state, workingDir) is missing the sessionId 3rd argument. This occurs in the execution-to-QA transition failure path. Without sessionId, session-scoped state lookups fall back to legacy paths, potentially generating continuation prompts for the wrong session.

Fix

Added sessionId as the 3rd argument: generateContinuationPrompt(state, workingDir, sessionId)

Evidence

All other call sites in the same function pass sessionId:

  • Line 281: generateContinuationPrompt(state, workingDir, sessionId)
  • Line 297: generateContinuationPrompt(state, workingDir, sessionId)
  • Line 303: generateContinuationPrompt(state, workingDir, sessionId)

Testing

  • npx tsc --noEmit passes
  • npm run lint passes
  • npm test -- --run passes
  • npm run build passes

…d transition

When execution-to-qa phase transition fails, the continuation prompt
was called without sessionId, unlike all other call sites at lines 281,
297, and 303. This caused session-scoped state lookups to fall back to
legacy paths, potentially generating prompts for the wrong session.

Confidence: high
Scope-risk: narrow
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

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