Skip to content

fix(session): preserve v1 prompt routing on follow-ups - #65288

Closed
imadal1n wants to merge 1 commit into
anomalyco:v1from
imadal1n:session-routing
Closed

imadal1n wants to merge 1 commit into
anomalyco:v1from
imadal1n:session-routing

Conversation

@imadal1n

Copy link
Copy Markdown

Summary

  • preserve the persisted session agent when a v1 prompt_async omits agent
  • preserve the matching non-default model variant when the request does not explicitly select another one
  • keep explicit request routing and valid agent-defined variants ahead of the persisted fallback
  • read SessionTable directly so the fallback does not use stale cached session state

Fixes #65287.

This targets the v1 branch because its createUserMessage routing contract differs from the redesigned development branch.

Regression coverage

The new HTTP session test admits a noReply prompt with a non-default agent, model, and variant, waits for persistence, then sends a second prompt with all routing fields omitted.

Without the fix, the second user message uses build and loses medium. With the fix, it retains the original plan, model, and medium routing.

Validation

  • bun test test/server/httpapi-session.test.ts test/server/httpapi-promptasync-context.test.ts — 24 passed
  • bun run --cwd packages/opencode typecheck
  • bun run script/build.ts --single --baseline --skip-install --skip-embed-web-ui
  • pre-push bun turbo typecheck — 30 tasks passed
  • Prettier check passed

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@imadal1n imadal1n closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant