Skip to content

fix(debugger): prevent stale session state on debug toggle - #502

Open
forhad-hosain wants to merge 1 commit into
devfrom
fix/debug-control
Open

fix(debugger): prevent stale session state on debug toggle#502
forhad-hosain wants to merge 1 commit into
devfrom
fix/debug-control

Conversation

@forhad-hosain

@forhad-hosain forhad-hosain commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

🎯 What's this PR about?

Fixes stale debug session state and UI artifacts when toggling the debugger off/on during workflow execution.

Key changes:

  • Disable debug toggle during active workflow processing (aligned with stop button disabled state)
  • Stop the debug run loop immediately on stop/toggle click
  • Add guards in processDebugStep and monitor event handlers to skip UI updates when debug is off
  • Fix stopDebugUI ordering so enableComponentEndpoints() runs correctly
  • Hide processing overlays immediately on debug stop
  • Reset debug status message on re-enable to prevent stale "Next Component: X" text
  • Clean up redundant stopDebugSession calls

📎 Related ClickUp Ticket

https://app.clickup.com/t/86evkdnye


💻 Demo (optional)

Before: Toggling debug off mid-run causes stale processing animations, ghost "Next Component" messages, and broken UI state on re-enable.

After: Debug toggle is disabled during active processing. Stop/toggle properly cleans up all session state, overlays, and messages.


✅ Checklist

  • Self-reviewed the code
  • Linked the correct ClickUp ticket
  • Tested locally (MANDATORY)
  • Marked as Draft if not ready for review

…toggle

- Disable debug toggle during active processing (aligned with stop button)
- Stop run loop immediately on stop/toggle via 'running' class removal
- Add guards in processDebugStep and monitor handlers to skip UI updates when debug is off
- Fix stopDebugUI ordering: remove .pinned/.disabled-endpoint before resetComponentsState
- Hide processing overlays immediately on debug stop
- Add dbg-running to resetComponentsState cleanup
- Reset debug status message on re-enable to prevent stale "Next Component" text
- Remove redundant stopDebugSession call and resetComponentsState in toggleSwitch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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