You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create session with a different root/working directory #1143
Open opencode in the /root directory
Spin up a session for /root/serviceA to implement a gRPC service.
Spin up another session for /root/serviceB to implement the gRPC client integration.
Use a third session for /root to run an acceptance test, since both will be in the agent's "view".
Outcome
The two sessions begin building independently.
Both make edits and get to a go build/test step, run go build ./... from the /root directory
Both builds find the same problems, some in each area of the code being worked
Agents start competing to edit the same code until I stop one (or both)
Question/Suggestion
Is there a clean way to set up this pair of agents without them getting in a code fight?
Can I do something like the aider --subtree-only option, but still allow read-only access to the rest of the repo?
Is there a way to change where the build/test tooling is executed within the session?
I would really like that. My use case is that I have a subagent for managing my notes, which are located in a different directory. Allowing it to change the directory into the "vault" would make it much less error-prone.
Is there a clean way to set up this pair of agents without them getting in a code fight?
I wonder if the idiomatic way to achieve this won't (eventually) be via shared sessions?
My use case might be slightly different, in that I encapsulate opencode in a rootless container (podman runtime). This involves some overhead that you tradeoff for some security.
In a scenario such as yours I have /root/ServiceA and /root/ServiceB running in a separate containers (both mounted to /app in their respective containers) with the TUI attached to a common server (http://127.0.0.1:4096).
Ideally they should be able to share sessions with each other across the isolated (container) network.
But right now selfhosted shared sessions appear to be only for enterprise? https://opencode.ai/docs/share#for-enterprises
Activity
ansh commentedon Jul 26, 2025
Would the best way to implement this be to move the
cwdfromApptoSession? @thdxrI would like to implement it
ariedov commentedon Sep 10, 2025
I would really like that. My use case is that I have a subagent for managing my notes, which are located in a different directory. Allowing it to change the directory into the "vault" would make it much less error-prone.
taqtiqa-mark commentedon Sep 28, 2025
I wonder if the idiomatic way to achieve this won't (eventually) be via shared sessions?
My use case might be slightly different, in that I encapsulate opencode in a rootless container (podman runtime). This involves some overhead that you tradeoff for some security.
In a scenario such as yours I have
/root/ServiceAand/root/ServiceBrunning in a separate containers (both mounted to /app in their respective containers) with the TUI attached to a common server (http://127.0.0.1:4096).Ideally they should be able to share sessions with each other across the isolated (container) network.
But right now selfhosted shared sessions appear to be only for enterprise?
https://opencode.ai/docs/share#for-enterprises
R44VC0RP commentedon Jan 25, 2026
This is actively being addressed in PR #9365 which adds per-session working directory support via
Session.directory.get()/.set()methods.Once merged, you'll be able to spin up sessions with different root directories for
/serviceA,/serviceB, etc.Keeping this open as the tracking issue.
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.