Skip to content

fix: debug nudge phantom turn loop - #278

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-05_debug-nudge-phantom-loop
Open

fix: debug nudge phantom turn loop#278
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-05_debug-nudge-phantom-loop

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Problem

When config.debug: true, ACP's debug notifications used sendIgnoredMessage() to persist nudge text and compress notifications to the conversation DB as ignored: true user messages. opencode's runtime loop detects the last user message by role == "user" WITHOUT checking the ignored flag, so the phantom user message triggers a new turn → model keeps working → calls compress → another notification → infinite loop.

Reported in issue #20 floor 1734.

Fix

Removed ALL sendIgnoredMessage calls from debug-mode notification paths:

  1. lib/hooks.ts (debug nudge callback): Removed sendIgnoredMessage, kept logger.debug + showToast
  2. lib/ui/notification.ts (debug compress notification): Replaced sendIgnoredMessage with logger.debug, kept showToast

Both sites now use logger.debug (file log) + showToast (popup) for debug visibility, without writing to the conversation DB.

Verification

  • TypeScript: 0 errors
  • Tests: 954 pass, 0 fail
  • Build: 386.21 KB
  • Deployed locally to ~/.cache/opencode/packages/opencode-acp@latest/

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