🤖 refactor: centralize workspace project runtime recreation#3142
🤖 refactor: centralize workspace project runtime recreation#3142ammar-agent wants to merge 1 commit intomainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab794ee19a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ab794ee to
989f30d
Compare
|
@codex review Addressed the single-project eager runtime construction feedback and added a regression test. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
This follow-up to #3125 centralizes how existing workspace runtimes are recreated after the SSH runtime simplification. It keeps persisted workspace paths and SSH sibling-path hints behind shared helpers instead of re-encoding the same rules in AI startup,
executeBash, file completions, and workspace lifecycle flows.Background
#3125 intentionally simplified the SSH runtime stack, but it left a handful of service callsites manually reconstructing
createRuntime(... workspacePath: getWorkspacePathHintForProject(...)). Those copies all had to remember the same persisted-path rules, which made the affected code harder to read and easier to drift.Implementation
getWorkspacePathHintForProject()to the path-related fields it actually needscreateRuntimeForWorkspaceProject()andresolveWorkspacePathForProject()inworkspaceProjectRepos.tsAIService, multi-projectWorkspaceServiceflows, andgetWorkspaceProjectRepos()WorkspaceServicetocreateRuntimeForWorkspace()so persisted checkout roots still come from one helper pathworkspaceProjectRepos.test.tswith coverage for single-project persisted roots and canonical sibling-path fallbackValidation
bun test src/node/services/workspaceProjectRepos.test.tsbun test src/node/services/workspaceService.test.ts -t 'preserves the current SSH workspace path and derives sibling legacy paths for multi-project completions when the persisted root matches that layout|aggregates multi-project completions using project-prefixed paths|executeBash workspace path resolution'bun test src/node/services/aiService.test.ts -t 'uses the persisted workspace root as cwd for multi-project ssh startup'make static-checkRisks
Low. This is a path-resolution cleanup around already-shipped behavior, so the main regression risk is choosing the wrong checkout root for existing workspaces. The helper-focused tests and the targeted AI/workspace service regressions cover the persisted-root and sibling-path cases that motivated the refactor.
Generated with
mux• Model:openai:gpt-5.4• Thinking:xhigh• Cost:$277.91