GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tui): retry same-directory session recovery by HootRock · Pull Request #56987 · anomalyco/opencode

Conversation

@HootRock

@HootRock HootRock commented Oct 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #56958

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Choosing the session's current directory from the location recovery prompt now retries the existing location sync instead of requesting a session move. This avoids queueing a no-op move behind an active step, preserves the location reference, and lets a successful sync clear the prompt. A failed retry keeps the recovery prompt available.

Moves to other directories and worktree creation retain their existing paths. This addresses the recovery action reported by @ZhenningLang; it does not change the transient-error trigger or reconnect policy covered by #55258 and #55940.

How did you verify your code works?

  • Added one real TUI renderer regression: open the recovery picker, choose the current directory, verify no move is sent, and wait for the prompt to disappear. It fails against the unchanged implementation because a move is issued.
  • bun test --timeout 30000 test/cli/tui/prompt-move.test.tsx from packages/tui: 20 passed, 103 assertions.
  • Independent review repeated the simplified suite ten times: 200 passed, 1,030 assertions, no blocking findings.
  • bun run typecheck from packages/tui: passed.
  • Root bun run check: passed, including lint (zero errors) and all 34 workspace typecheck tasks. On Windows, the tracked app declaration symlink was represented by a temporary hardlink to its actual target for this check.

The tests inject a 503 into location synchronization and then exercise the actual recovery picker. They do not reproduce the hourly eviction sweep or run an active model step.

Screenshots / recordings

No layout changes. Renderer assertions verify that the existing prompt disappears after recovery.

Checklist

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

AI-assisted implementation and independent review; reviewed and tested locally.


Added by the opencode bot (AI-generated).

Related: #43415, #55250, #49352

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HootRock
fix(tui): retry same-directory session recovery
f8ef960
@github-actions

github-actions Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

opencode-agent[bot]
opencode-agent Bot reviewed Oct 19, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This looks correct and safe to merge. I ran your two new tests against the base code and both fail there (a session move is sent). With this PR the whole prompt-move.test.tsx suite passes (21 tests), and bun run typecheck in packages/tui passes. I couldn't trigger the false prompt end to end, so I'm relying on these component-level tests.

On the code: location.set re-runs sync() even when the location hasn't changed, so the retry really happens and a successful sync clears the prompt. Spreading location.ref keeps the location that failed, because the error is only recorded when it matches the current location. And a move to the same directory never helped anyway: if the folder is really gone, the server rejects the move.

Public API: unchanged.

One small suggestion about the test, inline.

Related: #43415, #55250, #49352

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/tui/test/cli/tui/prompt-move.test.tsx Outdated
}
})

test.each([true, false])("choosing the current directory retries without moving (recovered=%s)", async (recovered) => {

@opencode-agent opencode-agent Bot Oct 19, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This test is harder to follow than the fix needs: a test.each that branches on recovered, with an early return in the middle, plus a new onlyOnError fixture flag and <Show> wrapper, and restoreLocation() changing the fixture's input. Could you keep just the recovered case: open the picker, choose the current directory, and check that no move is sent and the prompt goes away? That covers the fix. The still-failing branch adds little and makes the test longer.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@HootRock HootRock Oct 19, 2026

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Simplified in b345583: kept one recovered-case test, removed the conditional test branch and onlyOnError option, and stopped mutating the fixture input. The prompt now follows actual location info in the fixture. The regression still fails on the base implementation; the full file passes 20 tests, independent review passed 200 tests across ten repetitions, and typecheck/root checks pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@opencode-agent opencode-agent Bot Oct 19, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, b345583 covers it. I read the diff: the test is now a single clear case, and the conditional branch, the onlyOnError option and the mutation of the fixture's input are all gone. The new <Show> condition, which follows the actual location info, still shows the prompt for the existing recovery tests. Nothing more needed from my side on the test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HootRock
test(tui): simplify location recovery regression
b345583
@richie-rich90454

richie-rich90454 commented Oct 23, 2026

Copy link
Copy Markdown

One additional end-to-end reproduction from Windows 11, in case it's useful for testing beyond the component-level regression test.

Environment: Windows 11 25H2, OpenCode v2.0.32, official npm installation, Windows Terminal with PowerShell 5.

I've encountered the false location-unavailable prompt after server restarts, system time changes, skills-directory changes, and computer restarts followed by reopening a previously used project.

Occasionally, selecting the existing directory repeatedly returns me to the same prompt, leaving the TUI unusable until I force-terminate it with Ctrl+C. Afterward, launching opencode -c appears to let me continue the previous session successfully.

I haven't tested a build containing this PR or the related location-sync fixes, so I can't confirm whether the loop persists with these changes. I'm sharing this as an additional Windows reproduction, particularly for the repeated unsuccessful directory-selection case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Nov 19, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

tui: "Choose directory" on a false location-unavailable prompt waits for the running step and does not clear the prompt

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@HootRock @richie-rich90454
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.