feat(core): Debug mode #8994
Closed
neriousy wants to merge 15 commits into
Closed
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
neriousy
commented
Jan 18, 2026
Contributor
Author
There was a problem hiding this comment.
If you got any tips and tricks would be nice. Didn't have a chance to test out with the more popular models like opus / gemini cause I ran out of interference tokens
opencode-agent
Bot
force-pushed
the
dev
branch
from
January 30, 2026 14:32
00637c0 to
71e0ba2
Compare
thdxr
force-pushed
the
dev
branch
3 times, most recently
from
January 30, 2026 14:37
f1ae801 to
08fa7f7
Compare
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 free
to 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.
What does this PR do?
PR Summary: Debug Mode Feature
This PR introduces a new Debug Agent Mode that enables evidence-based debugging through structured instrumentation, log analysis, and a guided reproduction workflow.
HEAVILY INSPIRED FROM CURSOR DEBUG MODE
Overview
Key Features
1. New Debug Agent Mode
debugagent mode“Evidence-based debugging mode. Use this to generate hypotheses, add runtime instrumentation, analyze logs, and only then implement fixes.”
2. Structured Debug Workflow
The debug prompt (
packages/opencode/src/agent/prompt/debug.txt) defines a 7-phase workflow:3. Debug Infrastructure
Debug module (
src/debug/index.ts)Debug config injection
<debug_config>block into system prompts when using the debug agentLog format
NDJSON (one JSON object per line)
Required fields:
sessionIdrunIdhypothesisIdlocationmessagedatatimestamp4. Reproduction Steps System
New reproduction steps request/response system (
src/debug/repro.ts)TUI component (
reproduction-steps.tsx) for user interactionSupported actions:
proceedfixedskippedIntegrated into the session UI with keyboard navigation
5. API Endpoints
POST /ingest/:sessionIdIngest debug logs and append them to
.opencode/debug.logGET /reproduction-stepsList pending reproduction requests
POST /reproduction-steps/:requestID/replyReply to a reproduction prompt
POST /reproduction-steps/:requestID/rejectReject a reproduction prompt
6. UI Integration
(shown after permissions and questions)
How did you verify your code works?
2026-01-17.01-15-28.mp4