Skip to content

fix(tui): stop fetching placeholder session id on --continue - #47555

Open
woodsonl wants to merge 1 commit into
anomalyco:devfrom
woodsonl:tui-continue-dummy-id
Open

woodsonl wants to merge 1 commit into
anomalyco:devfrom
woodsonl:tui-continue-dummy-id

Conversation

@woodsonl

@woodsonl woodsonl commented Sep 6, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #47556

Type of change

  • Bug fix

What does this PR do?

opencode --continue seeds the session route with sessionID: "dummy" (from #31049). The route eagerly fetches that id, and the server rejects it because session ids must start with ses_, so a cold start shows "Unexpected server error". With OPENCODE_FAST_BOOT=1 the route mounts before the continue effect runs, so it fails reliably.

This PR seeds an empty id instead and skips the eager fetch when empty, so no request fires for the placeholder; the continue effect still resolves the real id and navigates. It also makes an explicit --session win over -c when both are passed, and navigates home instead of showing a blank screen when -c has no previous session.

How did you verify your code works?

Added packages/tui/test/app-lifecycle.test.tsx: pins OPENCODE_FAST_BOOT=1, delays the /session response, and asserts no request goes to /session/dummy and the eventual fetch targets the real session id. Confirmed the test fails on dev and passes here. Full tui suite (194 tests) and bun run typecheck pass.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@woodsonl
woodsonl force-pushed the tui-continue-dummy-id branch 2 times, most recently from de91ed0 to 9160c4f Compare September 8, 2026 22:06
@woodsonl
woodsonl force-pushed the tui-continue-dummy-id branch from 9160c4f to 1a5581c Compare September 12, 2026 02:29
--continue seeded the session route with sessionID "dummy", which the route
eagerly fetched; the server rejects it because ids must start with ses_, so
cold start showed "Unexpected server error". Seed an empty id and skip the
fetch instead, and let the continue effect resolve the real session.

Also make an explicit --session win over -c, and navigate home when -c finds
no previous session instead of leaving a blank screen.

Adds a regression test that fails on dev (FAST_BOOT + delayed /session
response) and asserts no request is made for the placeholder id.
@woodsonl
woodsonl force-pushed the tui-continue-dummy-id branch from 1a5581c to a451524 Compare September 14, 2026 21:58
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.

opencode --continue fails with "Unexpected server error" (TUI fetches /session/dummy)

1 participant