forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
bugSomething isn't workingSomething isn't working
Description
Bug
taskctl start fails when called from the PM MCP bridge (outside an active opencode session).
Root Cause
Two problems:
ctx.session.directory—ctx.sessionis not populated from the MCP bridgeInstance.directory— uses AsyncLocalStorage, only accessible withinInstance.provide()callback, also unavailable from the MCP bridge
Fix
The project directory must be sourced from somewhere that IS available in the MCP tool context. Options:
- Add a
directoryparameter totaskctl start(explicit, clean) — caller passes the project root - Read it from
Global.Path.dataor config — derive from stored project metadata - Use
process.cwd()— simplest, works if the MCP server is launched from the project root
Option 3 (process.cwd()) is the pragmatic fix: the opencode MCP server is always launched from the project directory, so process.cwd() returns the correct path.
Acceptance Criteria
-
taskctl start <issueNumber>works when called from PM MCP bridge - Feature branch is created and pushed successfully
- Existing tests pass
- Adversarial: APPROVED
Quality Gates
-
bun run typecheck— 0 errors -
bun test— 0 failures
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working