MCP tools don't populate output.output in the tool.execute.after hook —
the MCP content flows through OpenCode's internal parts pipeline instead.
This caused a crash: undefined is not an object (evaluating 'text.length')
in the truncate function.
- Add forbidden pattern: using experimental.chat.system.transform for
session-start injection causes Jinja 'System message must be at the
beginning' on Qwen-family GGUF models when orchestrator spawns subagents
- Add note to session-start.sh section explaining OpenCode delivery via
output.parts.unshift() on first chat.message turn (not system.transform)
runHook() return value was being discarded. The hook was called but its
additionalContext was never appended to output.response, so reminders
never appeared in the model's tool result.
experimental.chat.system.transform fires for task-spawned subagent sessions
after the task prompt (user message) is already in the conversation. Pushing
to output.system at that point places a system message at a non-zero position,
which Qwen3.6's strict Jinja chat template rejects with 'System message must
be at the beginning.'
Move session-start.sh injection to chat.message (first turn guard via
initializedSessions). Injected as a synthetic text part via unshift(), which
has no position constraints.
install.sh step 3 now symlinks all agent .md files into
~/.config/opencode/agents/ so project repos no longer need
per-project .opencode/agents/ symlinks.
AGENTS.md: add anti-pattern rule — do not assert a third-party tool
lacks a feature without fetching the tool's current docs first.
Instead of symlinking ~/.copilot/hooks/agent-support.json to dotfiles
hooks.json (which uses relative paths resolved from workspace root),
generate the file at install time with absolute paths to dotfiles hooks.
This means projects no longer need per-project hook stubs or symlinks.
A project only needs .agents/hooks/post-tool-use-remnant.sh (or similar)
for its own overlay, wired as a second PostToolUse in .github/hooks/.
OpenCode uses tool name 'bash' (not 'run_in_terminal') for shell execution.
The hook was early-exiting for 'bash' tool calls, leaving banned commands
unchecked. Added 'bash' to both the inspect allowlist and COMMAND extraction.
The MCP server requires @modelcontextprotocol/sdk and zod which are not
globally installed. Added .agents/mcp/package.json and updated install.sh
to run 'npm install --prefix' on first setup.