fix(antigravity): serve the transcript trace when a session has no .db - #236
Draft
VasiHemanth wants to merge 1 commit into
Draft
fix(antigravity): serve the transcript trace when a session has no .db#236VasiHemanth wants to merge 1 commit into
VasiHemanth wants to merge 1 commit into
Conversation
PR #229 taught _antigravity_cli_trace to fall back to brain/<sid>/.system_generated/logs/transcript*.jsonl when a session has no conversations/<sid>.db, which newer agy builds no longer write. The parser half works, but get_session_detail only called it when the .db existed, so the fallback never ran for the sessions it was written for. Those sessions dropped through to the brain markdown branch instead. _antigravity_cli_trace already does `if db_path and db_path.exists()` internally, so the outer guard was redundant as well as harmful. Drop it and let the function decide. Measured over the 167 Antigravity brain sessions on this machine: sessions returning zero messages : 59 -> 35 total messages served : 6724 -> 7814 (+1090) kind=antigravity_cli : 62 -> 91 No session loses events: the guard only ever affected sessions without a .db, and those previously always fell through to brain markdown. The regression test drives get_session_detail rather than the parser, since the parser was never the broken half — it fails on the prior code with "fell through to 'antigravity_brain'". Co-Authored-By: Claude Opus 5 (1M context) <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.
Follow-up to #229.
The problem
#229 taught
_antigravity_cli_traceto fall back tobrain/<sid>/.system_generated/logs/transcript*.jsonlwhen a session has noconversations/<sid>.db— neweragybuilds no longer write one. That half works.But
get_session_detailonly called it when the.dbexisted:So the fallback never ran for exactly the sessions it was written for. All 29 sessions #229 restores have no
.db; they dropped through to the brain-markdown branch, and 26 of them rendered nothing at all. The bug hwantage reported was still on screen after the merge.This was my miss reviewing #229 — I validated
_antigravity_cli_trace(db, sid)directly, which exercises a fallback the endpoint never reached.The fix
_antigravity_cli_tracealready doesif db_path and db_path.exists()internally, so the outer guard was redundant as well as harmful. Drop it and let the function decide.Measured
Over the 167 Antigravity brain sessions on this machine, through the running API:
Spot-check on two sessions that previously rendered nothing:
No session loses events. The guard only ever affected sessions without a
.db, and those previously always fell through to brain markdown; the arithmetic closes exactly (6724 + 1090 = 7814).The 35 still returning zero have neither a usable transcript nor a
.db— pre-existing and out of scope here.Test
test_session_detail_uses_transcript_trace_when_there_is_no_sqlite_dbdrivesget_session_detail, not the parser, since the parser was never the broken half. It also plants atask.mdso it pins the precedence (real trajectory beats synthesized markdown).Against the prior code it fails with
AssertionError: fell through to 'antigravity_brain'. With the fix,test_antigravity_cli.pyis 13 passed. Full backend suite: 382 passed, same 23 pre-existing environment failures asmain.🤖 Generated with Claude Code