fix(shellterm): open session-scoped terminals in the session's worktree#3106
Open
ikeshavvarshney wants to merge 1 commit into
Open
fix(shellterm): open session-scoped terminals in the session's worktree#3106ikeshavvarshney wants to merge 1 commit into
ikeshavvarshney wants to merge 1 commit into
Conversation
Opening a terminal from a worker/orchestrator session view resolved the working directory from the project's registered root only, dropping the session id and colocating the shell with the wrong checkout/branch. Adds a SessionWorkspaceLocator alongside the existing ProjectRootLocator so the shellterm service can resolve a session id to its live workspace (worktree) and use it ahead of the project root; falls back to the project root when a session has no workspace of its own, and to the data dir when neither is given. Project-board and no-context opens are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #3061. Terminal opened from session view landed in project's registered root instead of that session's worktree — session id never reached working-directory resolver, only project id did.
Adds
SessionWorkspaceLocatortointernal/service/shellterm, resolved through new daemon-side adapter over real session service.resolveShellTerminalWorkingDirprecedence order now:A session with no workspace of its own (or no session id provided) falls back through the existing chain unchanged.
Renderer, DTO, and OpenAPI spec already carried
sessionIdend-to-end from an earlier pass — the gap was purely in the backend resolver.Test plan
go build ./...go vet ./...sessionIdin the request body reaches the service input.sessionIdscope.POST /api/v1/shell-terminalsrequest used by the UI with both ids present.workingDirresolved to the session's real worktree.pwd,git rev-parse --show-toplevel, andgit branch --show-currentall matched the worktree and itsao/<session>/rootbranch, rather than the registered repository root.sessionId) still resolves to the project root, unchanged.