feat: implement debug bridge for live session debugging#101
Merged
laynepenney merged 2 commits intomainfrom Jan 23, 2026
Merged
feat: implement debug bridge for live session debugging#101laynepenney merged 2 commits intomainfrom
laynepenney merged 2 commits intomainfrom
Conversation
Add a debug bridge feature that streams events to a JSONL file for real-time debugging of Codi sessions. This enables another Claude instance or debugging tool to observe session activity. Features: - --debug-bridge CLI flag to enable event streaming - Events written to ~/.codi/debug/events.jsonl - Session metadata in ~/.codi/debug/session.json - Event types: session_start, session_end, user_input, tool_call_start, tool_call_end, tool_result, api_request, api_response, context_compaction, error, model_switch - Auto-truncation of long inputs/outputs to keep events manageable - Proper shutdown handling on /exit and SIGTERM/SIGINT Usage: codi --debug-bridge # or CODI_DEBUG_BRIDGE=true codi Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update tests to handle the presence of ~/.codi/models.yaml global config file. Tests now conditionally check behavior based on whether global config exists. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
Self-Review
Ready to merge. |
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.
Summary
--debug-bridgeCLI flag orCODI_DEBUG_BRIDGE=trueenvironment variable~/.codi/debug/events.jsonl~/.codi/debug/session.jsonEvent Types
session_startsession_enduser_inputtool_call_starttool_call_endtool_resultapi_requestapi_responsecontext_compactionerrorUsage
Example Output
{"type":"session_start","timestamp":"2026-01-23T13:10:00.000Z","sessionId":"debug_20260123_131000_abc1","sequence":0,"data":{"provider":"anthropic","model":"claude-sonnet-4-20250514","cwd":"/project","pid":12345}} {"type":"user_input","timestamp":"2026-01-23T13:10:05.000Z","sessionId":"debug_20260123_131000_abc1","sequence":1,"data":{"input":"Hello, can you help?","isCommand":false,"length":20}} {"type":"api_request","timestamp":"2026-01-23T13:10:05.100Z","sessionId":"debug_20260123_131000_abc1","sequence":2,"data":{"provider":"anthropic","model":"claude-sonnet-4-20250514","messageCount":1,"hasTools":true}}Test plan
--debug-bridgeflag is used🤖 Generated with Claude Code