round-trip-tracker: consolidate stale PRs #6, #7, #8 - #9
Open
rajkripal wants to merge 3 commits into
Open
Conversation
`extract_text` only checked for OpenClaw-style `toolCall`/`toolResult` types, so tool calls and results in Claude Code sessions (which use `tool_use`/`tool_result`) were silently skipped. Brain signal detection returned 0 hits on every Claude Code session because cashew Bash calls appeared in `tool_use` blocks that were never read. Fix: check both type names in each branch. For `tool_use`, read args from `input` (falling back to `arguments`). Also handle `attachment` entries in `load_from_jsonl` so startup hook results, which carry brain context, are included as user messages.
Two fixes for the 0% brain usage bug: 1. JSONL parser: add a branch for attachment entries where attachment.type == "hook_success", extracting content from attachment.content instead of the missing message key. 2. extract_task_chains: after building all chains, do one session-level has_brain_context(messages, 0, len(messages)) pass. Startup hook_success entries land before the first user message so per-chain checks always miss them; session-level propagation fixes this. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Capture the per-message model from Claude Code JSONL entries (falling back to CASHEW_CLAUDE_MODEL/CLAUDE_MODEL or the bridge's current-model.txt when the transcript doesn't carry one) and stamp it on each logged chain as session_model. Report now breaks stats out by model so the "better models use tools better" hypothesis is testable instead of vibes.
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.
Consolidates three stale, stacked PRs into a single mergeable script on main. #6, #7, and #8 were opened sequentially (each based on the previous branch) and never landed, so
round-trip-tracker.pydoesn't exist on main at all yet.This cherry-picks the three round-trip-tracker commits from that chain, in order, onto current main:
No conflicts between them; cherry-pick was clean. Verified with
python3 -m py_compile round-trip-tracker.pyand a smoke test via--from-jsonlagainst a sample transcript (loads messages, logs a chain, first_try_success reported correctly).Leaving #6, #7, #8 open for you to close at your discretion.