Uh oh!
There was an error while loading. Please reload this page.
feat(opencode): add system prompt debug command - #39905
Open
Rexarrior wants to merge 1 commit into
Open
Conversation
This was referenced Jul 31, 2026
Rexarrior
commented
Aug 13, 2026
Author
Hi! Friendly bump on this PR. The implementation is locally verified, but the required CI workflows are still waiting for maintainer approval. Could someone approve them and take a look when convenient? |
3 tasks
Rexarriorforce-pushed
the
system-prompt-export
branch
from
August 21, 2026 09:42
592ebb8 to
600aa5aCompare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Related to #24990, #39033, and #33333.
Type of change
What does this PR do?
Adds a local CLI debug command:
The command prints the resolved effective system prompt for the current project, agent, and model. It supports optional
--agentand--modelflags.This is useful when debugging prompt-affecting customization layers such as
AGENTS.md,opencode.jsoninstructions, skills, MCP instructions, custom agents, andexperimental.chat.system.transformplugins.The implementation uses the same existing system prompt services used by normal request assembly:
SystemPrompt.provider(model)for the model-family base promptSystemPrompt.environment(model)for environment contextInstruction.system()forAGENTS.mdand configured instruction filesSystemPrompt.mcp(agent)for MCP instructionsSystemPrompt.skills(agent)for the available skills blockexperimental.chat.system.transformfor plugin transformationsThis is intentionally narrower than a full context dump or export feature. It does not persist anything to
opencode.db, does not change transcript export behavior, does not add a TUI surface, and does not dump the full request/message array.How did you verify your code works?
bun typecheckinpackages/opencodebun --conditions=browser ./src/index.ts debug prompt --helpbun --conditions=browser ./src/index.ts --pure debug prompt --model opencode/big-picklebun run build --single --skip-install --skip-embed-web-uidist/opencode-darwin-arm64/bin/opencode --versiondist/opencode-darwin-arm64/bin/opencode debug prompt --helpbun turbo typechecksuccessfullyScreenshots / recordings
N/A. CLI-only change.
Checklist