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): resolve actual cwd when file listing fails by dalisoft · Pull Request #64128 · anomalyco/opencode

Conversation

@dalisoft

@dalisoft dalisoft commented Nov 15, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Issue for this PR

Related: #56386, #64126 (closed as duplicate), #56389

The run/mini part of #56386 is already covered by #56389. This PR is for the full TUI path, which can hit the same symptom: if the initial file.list fails, the TUI falls back to api.location.get() with no directory, so it uses the server's active location instead of the client's actual cwd. With a stale shared service pointing at another directory, the session can open in the wrong place.

Type of change

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

What does this PR do?

The TUI already starts from process.cwd(), but its fallback did not preserve that directory:

Effect.catch(() => Effect.tryPromise(() => api.location.get()))

This is a one-line change: pass { location: { directory: process.cwd() } } to the fallback. No public API changes.

How did you verify your code works?

  • bun run typecheck in packages/tui — no errors
  • Pre-push hook ran the full typecheck task graph successfully.
  • The reviewer independently verified with a proxy that made /api/fs/list fail: the base opened in the server's directory, and this branch opens in the client cwd.

Screenshots / recordings

N/A — CLI behavior only.

Checklist

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

AI assistance: AI-assisted, human-reviewed. Runtime: OpenCode v2.3.0. Model: DeepSeek V4.1 Flash via OpenCode GO (opencode-go/deepseek-v4.1-flash#max).

Verify locally: Verify issue #56386 in the full TUI locally and confirm the session opens in the actual cwd.


Added by the opencode bot (AI-generated).

Related: #56386

Sorry, something went wrong.

Uh oh!

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

All reactions
This was referenced Nov 15, 2026
cli: run resolves the workspace from $PWD instead of the process cwd (still on 2.0.32) #56386
Open
fix(cli): use actual cwd instead of stale PWD #64126
Closed
opencodejr[bot]
opencodejr Bot reviewed Nov 15, 2026
View reviewed changes

@opencodejr opencodejr 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.

The fix works. I put a proxy in front of a server started in another directory, made the file-listing request (/api/fs/list) fail, and started the full TUI from a separate directory. On the base, the fallback location.get() sends no directory, so the TUI opened in the server's directory. With this PR, the fallback asks for the client's cwd and the TUI opens there. The new tests pass, and tsc -b in packages/tui is clean.

Public API: unchanged. This only changes TUI startup code.

The one thing worth changing is structure. The fix is a single argument at the existing call site, but the PR adds a single-use helper module, a hand-written copy of the client's types, a try/catch and a test file around it. The repo's style guide asks to avoid single-use helpers and try/catch (details inline). Please inline the change in app.tsx and drop location.ts and test/location.test.ts, so the fix stays minimal.

Related: #56386

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/tui/src/app.tsx Resolved

Uh oh!

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

@dalisoft
fix(tui): resolve actual cwd when file listing fails
8c25ef1
@dalisoft
dalisoft force-pushed the fix/tui-location-fallback branch from 7693042 to 8c25ef1 Compare November 15, 2026 22:14
opencodejr[bot]
opencodejr Bot reviewed Nov 15, 2026
View reviewed changes

@opencodejr opencodejr 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.

My earlier point is addressed: the PR is now the one-line fallback change. I retested with the same proxy setup (file listing made to fail, server running in another directory). The TUI now opens in its own cwd instead of the server's directory, and tsc -b in packages/tui is clean. Public API: unchanged. Nothing else to raise.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot mentioned this pull request Nov 15, 2026
📊 AI CLI 工具社区动态日报 2026-11-16 litang9/big_model_radar#711
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@dalisoft
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.