Skip to content

feat: add Cursor-style Debug Mode with hypothesis-driven instrumentation#1523

Open
potb wants to merge 13 commits intocode-yeongyu:devfrom
potb:feat/debug-mode
Open

feat: add Cursor-style Debug Mode with hypothesis-driven instrumentation#1523
potb wants to merge 13 commits intocode-yeongyu:devfrom
potb:feat/debug-mode

Conversation

@potb
Copy link
Contributor

@potb potb commented Feb 5, 2026

Summary

Adds a Cursor-style Debug Mode for hypothesis-driven runtime debugging with lightweight instrumentation and a local NDJSON log server.

New Features

  • /debug command with a 7-step workflow and guided template
  • runtime-debugging skill with:
    • Debug server code (port 7777)
    • NDJSON schema for structured logging
    • JS/TS/Python/Go instrumentation examples
    • Region markers (@DEBUG:START/@DEBUG:END) for systematic cleanup
    • Verification steps
  • CSP detection and handling instructions for frontend debugging
  • Keyword detection for debug terms (English, Korean, Japanese, Chinese, Vietnamese) that injects a [debug-mode] message
  • .gitignore updated to exclude .opencode/debug/

Testing

37 tests added/updated across commands, skills, and keyword detector; all passing.


Supersedes #1113


Summary by cubic

Introduces a guided Debug Mode with hypothesis-driven instrumentation and a local NDJSON log server to diagnose runtime issues and cleanly remove instrumentation.

  • New Features
    • /debug command with a 7-step workflow and template.
    • runtime-debugging skill: debug server (port 7777), NDJSON schema, JS/TS/Python/Go examples, region markers, CSP guidance, and cleanup steps.
    • Keyword detection for debug terms (English, Korean, Japanese, Chinese, Vietnamese) that prepends a [debug-mode] message.
    • .gitignore updated to ignore .opencode/debug/.
    • 37 tests added/updated across commands, skills, and keyword detector; all passing.

Written for commit 2203a23. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 11 files

Confidence score: 3/5

  • Potential security exposure in src/features/builtin-skills/skills.ts: debug server template binds to all interfaces by default, making unauthenticated /ingest reachable on the local network
  • Risk is moderate because it can expose an endpoint unexpectedly; binding to localhost would reduce impact
  • Pay close attention to src/features/builtin-skills/skills.ts - default host binding exposes /ingest beyond localhost.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/features/builtin-skills/skills.ts">

<violation number="1" location="src/features/builtin-skills/skills.ts:94">
P2: Debug server template binds to all interfaces by default; without a hostname it listens on 0.0.0.0/::, exposing the unauthenticated /ingest endpoint to the local network. Bind explicitly to localhost for safety.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

potb added 2 commits February 5, 2026 18:08
- Update command count test to expect 8 commands (added stop-continuation)
- Remove debug keywords from analyze pattern to prevent double-match
- Add getMainSessionID spy to keyword-detector tests to handle mock pollution
- Add beforeEach reset and test imports to unstable-agent-babysitter tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant