fix: address PR review comments — traceback, CORS parsing, byte sizes, DecisionTree collapse#2
Merged
Conversation
4 tasks
…onTree collapse Co-authored-by: acailic <12486087+acailic@users.noreply.github.com> Agent-Logs-Url: https://github.com/acailic/agent_debugger/sessions/40fb79e4-9e45-40b9-aeaa-110d748e671b
Copilot
AI
changed the title
[WIP] Fix comprehensive bug fixes for agent debugger
fix: address PR review comments — traceback, CORS parsing, byte sizes, DecisionTree collapse
Mar 23, 2026
There was a problem hiding this comment.
Pull request overview
This PR applies a focused set of follow-up fixes to address prior review comments across the SDK, API, collector, and frontend tree visualization—primarily improving traceback capture, configuration parsing, byte-accurate size validation, and persistent UI collapse behavior.
Changes:
- Fixes
TraceContext.__aexit__to format the exception from the provided(exc_type, exc_val, exc_tb)instead of relying on the currently-active exception. - Hardens CORS origin parsing to drop empty entries and updates collector validators to enforce payload size limits in UTF-8 bytes.
- Persists DecisionTree collapse state outside the ephemeral D3 hierarchy and adds missing
data-idattributes used by the collapsed indicator selector; removes an unused TS import breakingtsc.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
frontend/src/components/DecisionTree.tsx |
Persist collapse state across renders via ref-backed map and ensure node elements get data-id for selectors. |
frontend/src/api/client.ts |
Removes unused TreeNode type import to keep tsc clean. |
collector/server.py |
Switches size checks from character count to UTF-8 byte count for correct DoS-limit enforcement. |
api/main.py |
Filters out empty CORS origins after split/strip to avoid phantom entries from trailing commas. |
agent_debugger_sdk/core/context.py |
Formats traceback from the exception arguments passed to __aexit__, fixing “NoneType: None” when no active exception exists. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
acailic
pushed a commit
that referenced
this pull request
Mar 30, 2026
Cover search returning no results (#1), error count semantic mismatch (#2), null optional fields (#3), drift detection data requirements (#4), empty behavior alerts (#5), and zero cost/tokens (#6). 29 tests across 3 files: 27 passing, 2 xfail documenting real bugs where session.errors is not auto-computed and the tokens-implies-cost invariant is not enforced. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Five issues identified in code review of the comprehensive bug-fix PR.
Changes
context.py—TraceContext.__aexit__usedtraceback.format_exc(), which reads the currently active exception rather than theexc_type/exc_val/exc_tbargs passed to it. When invoked manually (e.g. intrace_tool/trace_llm) with no active exception, this produced"NoneType: None". Now usesformat_exception(exc_type, exc_val, exc_tb)with aformat_exception_onlyfallback whenexc_tb is None.api/main.py— CORS origin list now filters empty strings after split/strip, preventing phantom entries from trailing commas (e.g."https://a.com,") inAGENT_DEBUGGER_CORS_ORIGINS.collector/server.py— Size validators usedlen(json.dumps(v))(character count), undercounting multi-byte characters. Switched tolen(json.dumps(v, ensure_ascii=False).encode('utf-8'))for accurate byte enforcement.DecisionTree.tsx— collapse state —d.data._collapsedwas set on the ephemeral D3 hierarchy node, which is fully reconstructed fromconvertToD3Tree(tree)on every render, discarding all mutations. Collapse state is now persisted in a stablecollapsedStateRef: Map<string, boolean>keyed by event id and applied during hierarchy construction.DecisionTree.tsx— collapsed indicator selector —.node[data-id="..."]selector never matched because node<g>elements lacked the attribute. Added.attr('data-id', (d) => d.data.id)to the node selection.client.ts— Removed unusedTreeNodeimport that was causingtscto exit non-zero.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.