fix(persona-kit): repair opencode one-shot invocation
Closes #269
Summary
- stop passing unsupported
--dirtoopencode run; the runtime already spawns the child with the requestedcwd - stop overriding the generated persona agent model with the CLI
--modelflag - normalize bare OpenCode persona model IDs to
opencode/<model>in the generatedopencode.jsonagent config while preserving already-qualified values - add regression coverage using a truthy working directory and bare
deepseek-v4-flash-freemodel
Why
The non-interactive path was adding two stale CLI arguments after buildInteractiveSpec had already moved OpenCode model selection into opencode.json. Current OpenCode rejects --dir, and its --model parser requires provider/model values. The child process already receives cwd through spawnAndCapture, while the generated agent config carries the persona model selected by --agent. Since OpenCode agent configs also require provider/model-id, bare model IDs are normalized to the harness provider before serialization.
Validation
pnpm --filter @agentworkforce/persona-kit test(287 passed)pnpm --filter @agentworkforce/persona-kit lintpnpm --filter @agentworkforce/persona-kit typecheck
Downstream note
The daytona-monitor, cloudflare-monitor, gcp-watcher, and neon-monitor personas in AgentWorkforce/agents use the OpenCode harness with bare model strings. Before this fix, they would be exposed to the same invalid provider/model resolution on affected OpenCode versions; this PR does not modify that repository.