Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
@jlongster The body already has The CLI regressions and related TUI tests pass locally, as do the pre-push typechecks. I've also left the branch on #47665 for the reporter to try with their remote setup. |
|
Independent corroboration from a real cross-machine setup, since the PR notes the tests stop at a local HTTP fixture rather than a true remote run. Setup: Linux client to a Linux central server over an SSH tunnel, attaching with We hit this independently and arrived at the same two call sites as this PR. Confirming the second half is essential: skipping Also worth recording: One addition we made that this PR doesn't cover: We also initially kept the original Happy to run the branch on this setup if that's useful. |
|
Updated in 8bdbdb9. TuiPathsProvider now uses the server-resolved launch directory instead of the client process.cwd(), so cwd-scoped tab state and other client-side path consumers stay on the attached project. I added coverage for storing tabs under a remote launch directory, updated the branch to current v2, and reran the TUI suite (1,347 passing, 2 skipped) plus the full pre-push lint/typecheck. @kernel-oops The branch is ready if you still have the SSH-tunnel setup available for another run. |
|
Tested The directory fix works. I ran the branch build as a client on a separate machine, from But I could not complete a full attach, and I think this is a separate issue worth knowing about. The client fails its preflight with:
So it is not version skew between the client and an older server — the branch's own build does it too. It looks like the client's health preflight expects a surface that a manually started That matters for this PR's use case specifically: For completeness, the chdir behaviour was verified on a genuinely remote-only path; everything after that point is blocked by the health preflight rather than by anything in this change. |
|
Good to have the remote-only directory case checked. I looked at the current branch before chasing the preflight separately: the client calls server.info, whose generated request is GET /api/info, and the server registers that same route. It does not request /api/health. Could you check the exact GET /api/info response through the same tunnel, and include the client executable/version you ran? If /api/info is also 404 against a freshly started branch server, that is a separate remote-serve issue worth isolating, but I would rather not mix it into this directory fix without that reproduction. |
|
@jlongster This should be ready for review now. The branch has an independent cross-machine check using a directory that exists only on the server; the local chdir failure is gone, and the TUI path follow-up is included. The branch is mergeable and the checks are green. It still has |
|
Follow-up on the preflight question: that failure was our setup, not this branch. Our server required a password and the client wasn't sending one. The 401 comes back with an empty body, which the client reports as "did not provide a compatible V2 health response" / Retested
Together with the earlier remote-only Separately, a 401 surfacing as an incompatible health response is misleading; that seems worth its own issue. |
|
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:
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. |
Issue for this PR
Closes #47665
Type of change
What does this PR do?
opencode2 /remote/project --server <url>tries to enter/remote/projecton the client, so a directory that only exists on the server fails withENOENTbefore connecting.Skip the local
chdirwhen--serveris set and pass the directory through to the TUI's initial location request. Skippingchdiralone wasn't enough: that request still used the client's cwd.If the server rejects an explicit directory, return the error instead of silently opening its default project. Local launches and remote launches without a directory keep their existing behavior.
How did you verify your code works?
Added seven tests that launch the real CLI against a local HTTP fixture. They cover both argument orders, remote absolute/relative paths, local directory handling, and the error fallback. The remote path cases failed before the fix; all seven now pass. The fixture stops before the interactive renderer, so this isn't a Mac-to-Linux end-to-end run.
With Bun 1.4.2 on macOS:
bun typecheckpassed in both packages.Screenshots / recordings
Not applicable; no visual changes.
Checklist