Fork of sst/opencode for the cae-agents
multi-agent system.
- Fork origin:
git@github.com:VinQut/opencode.git - Working branch:
dev - Forked-from upstream commit:
c5db39f62(sst/opencode, release line v1.15.1)
Debugging visibility. cae-agents assembles each agent's prompt from many layers (agent body, opencode env, skills, per-call board snapshot). Stock opencode cannot show the final assembled request. This fork adds one env-gated log of the exact LLM request so we can inspect it during ongoing testing.
Note: the fork is NOT needed to suppress gpt.txt. Verified from source —
PROMPT_GPT (gpt.txt) is imported only in session/system.ts, returned only
by provider(), and provider() has exactly one consumer: session/llm.ts,
inside the ternary input.agent.prompt ? [agent.prompt] : provider(). Every
cae-agents agent ships a prompt body, so gpt.txt is never read for them.
gpt.txt is therefore left at the upstream original.
packages/opencode/src/session/llm.ts— whenOPENCODE_DUMP_SYSTEM=<file>is set, appendsJSON.stringify({ messages, tools })of the fully assembled request (system + conversation, exactly as opencode builds it) plus the resolved tools, at the point right after the request is assembled and before the provider call. No-op when the env var is unset.
(bun.lock, packages/core/src/models-snapshot.*,
packages/opencode/package.json may show as modified — these are
build-script artifacts regenerated by bun run build, not intentional
edits.)
Pinned. We do NOT track upstream dev. To pull upstream changes:
git remote add upstream https://github.com/sst/opencode.git # one-time
git fetch upstream
git cherry-pick <commit> # or rebase onto a chosen upstream tag
Bump the "Forked-from upstream commit" line whenever the pin moves.
bun install
bun run --cwd packages/opencode build # script/build.ts -> dist/<platform>/bin/opencode
The build produces binaries for all platforms, including
dist/opencode-linux-x64/bin/opencode used by the cae-agents Docker image.