anomalyco / anomalyco/opencode
[FEATURE]: Dispatch-time session location for subagents (task directory parameter, or per-agent isolation: worktree)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem: The subagent tool creates every child session in the parent's location. There is no directory parameter on the dispatch, and no location or isolation field in agent definitions. A subagent that should work in its own git worktree has to be moved after the fact: dispatch in the background, then call session_move on the child, or instruct the worker to move itself as its first action. Until the move lands, the child runs in the parent's checkout, where it can read and write freely.
Request, one of: (1) a directory parameter on the subagent dispatch, so the child session starts there; (2) a per-agent isolation: worktree field, as Claude Code has, where the harness creates a worktree, runs the agent in it, and removes it when the agent finishes without changes.
Workaround in use today: dispatch in the background, then immediately session_move the child by sessionID. It works, but it is two calls instead of one parameter, and there is still a window before the move takes effect.
Related earlier requests closed by automation, still relevant: #34872, #34216, #29271, #17994.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the subagent dispatch entry point and the existing session_move flow described in the issue. Compare the two requested approaches—dispatch-time directory selection and per-agent worktree isolation—and determine which session lifecycle and cleanup paths they affect. Done means a child session starts in the requested location without the current two-call workaround or an unsafe transition window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- ai-infra-agents, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100