diff options
| author | t <t@tjp.lol> | 2026-06-13 23:45:59 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-15 15:08:32 -0600 |
| commit | 02b4c7a35ac0b714bc045d54fb4bb45d1ce4e490 (patch) | |
| tree | 134196a82dd6fdd55b735be4c0cf38428c85038d /tmp | |
| parent | 71643a5d69ffc40882c9fcde3cc8a3bcf02d7396 (diff) | |
Add Codex Responses support and session debugging
Teach provider config and auth resolution about the Codex Responses
dialect, including user-facing `style = "openai_responses"` with
`dialect = "codex"`. Serialize and parse Responses traffic with
provider-specific reasoning replay, assistant phase metadata, and robust
function-call assembly keyed by `output_index` so streamed tool inputs
survive proxy quirks and empty terminal payloads.
Also persist thinking origins and message metadata across sessions, add
the Anthropic interleaved-thinking header switch, write per-session
debug logs, and improve the TUI and scripts for inspecting tool output
and session costs.
Diffstat (limited to 'tmp')
| -rw-r--r-- | tmp/pi_session_cost_analysis.json | 288 |
1 files changed, 288 insertions, 0 deletions
diff --git a/tmp/pi_session_cost_analysis.json b/tmp/pi_session_cost_analysis.json new file mode 100644 index 0000000..cc40030 --- /dev/null +++ b/tmp/pi_session_cost_analysis.json @@ -0,0 +1,288 @@ +{ + "root": "/Users/travis/Code/config/dot-pi/agent/sessions", + "sessions_scanned": 495, + "sessions_with_usage": 454, + "sessions_without_usage": 41, + "assistant_messages": 28636, + "assistant_messages_with_usage": 28636, + "parse_errors": 0, + "cache_active_sessions": 216, + "pooled_totals": { + "input": 648085868, + "output": 11386363, + "cache_read": 984042157, + "cache_write": 65075433 + }, + "pooled_metrics": { + "prompt_tokens": 1697203458, + "billable_tokens": 1708589821, + "prompt_to_output_ratio": 149.0558010490268, + "input_to_output_ratio": 56.91772412314626, + "cache_hit_rate": 0.9379712687878963, + "cache_coverage": 0.6181448576803453, + "prompt_reuse_rate": 0.5798021164531472, + "output_share": 0.006664187542294857, + "prompt_share": 0.9933358124577052, + "input_share": 0.37931038803724676, + "cache_read_share": 0.5759382064116839, + "cache_write_share": 0.0380872180087745 + }, + "recommended_weights": { + "pooled_token_mix": { + "input": 0.37931038803724676, + "output": 0.006664187542294857, + "cache_read": 0.5759382064116839, + "cache_write": 0.0380872180087745 + }, + "mean_session_mix": { + "input": 0.549819370457156, + "output": 0.05134274693943982, + "cache_read": 0.3229895728469125, + "cache_write": 0.07584830975649165 + }, + "median_session_mix": { + "input": 0.7903769253077484, + "output": 0.014961511819985934, + "cache_read": 0.0, + "cache_write": 0.0 + } + }, + "per_session_distributions": { + "billable_tokens": { + "count": 454, + "mean": 3763413.702643172, + "median": 315231.0, + "p10": 20182.100000000002, + "p90": 11804297.1, + "min": 2244, + "max": 101170942 + }, + "cache_coverage": { + "count": 454, + "mean": 0.40473111896757075, + "median": 0.0, + "p10": 0.0, + "p90": 0.9999679722217543, + "min": 0.0, + "max": 0.9999922748401895 + }, + "cache_hit_rate": { + "count": 216, + "mean": 0.8218859540276632, + "median": 0.9487389145525554, + "p10": 0.374890408374274, + "p90": 1.0, + "min": 0.0, + "max": 1.0 + }, + "cache_read_share": { + "count": 454, + "mean": 0.3229895728469125, + "median": 0.0, + "p10": 0.0, + "p90": 0.9389935967096287, + "min": 0.0, + "max": 0.9893885889087582 + }, + "cache_write_share": { + "count": 454, + "mean": 0.07584830975649165, + "median": 0.0, + "p10": 0.0, + "p90": 0.267090715504709, + "min": 0.0, + "max": 0.999839897534422 + }, + "input_share": { + "count": 454, + "mean": 0.549819370457156, + "median": 0.7903769253077484, + "p10": 3.1707600618505675e-05, + "p90": 0.9974440745899954, + "min": 7.709723608187813e-06, + "max": 0.9999909002957817 + }, + "input_to_output_ratio": { + "count": 454, + "mean": 829.6580689032315, + "median": 8.629654523169638, + "p10": 0.00421753985473397, + "p90": 409.9444444444443, + "min": 0.0010703582132153562, + "max": 109892.68181818182 + }, + "output_share": { + "count": 454, + "mean": 0.05134274693943982, + "median": 0.014961511819985934, + "p10": 0.0018531251145351706, + "p90": 0.16915366650275257, + "min": 9.099704218250615e-06, + "max": 0.5140911569511498 + }, + "output_tokens": { + "count": 454, + "mean": 25080.09471365639, + "median": 7470.5, + "p10": 365.8000000000001, + "p90": 78289.59999999998, + "min": 1, + "max": 279572 + }, + "prompt_reuse_rate": { + "count": 454, + "mean": 0.32683124761341736, + "median": 0.0, + "p10": 0.0, + "p90": 0.9461329490069706, + "min": 0.0, + "max": 0.9914821057091003 + }, + "prompt_share": { + "count": 454, + "mean": 0.9486572530605601, + "median": 0.985038488180014, + "p10": 0.8308463334972475, + "p90": 0.9981468748854648, + "min": 0.48590884304885024, + "max": 0.9999909002957817 + }, + "prompt_to_output_ratio": { + "count": 454, + "mean": 938.8894985366835, + "median": 65.83823653274615, + "p10": 4.91178438425, + "p90": 538.8489050453238, + "min": 0.9451803176902779, + "max": 109892.68181818182 + }, + "prompt_tokens": { + "count": 454, + "mean": 3738333.607929515, + "median": 308096.0, + "p10": 19041.5, + "p90": 11756748.7, + "min": 2149, + "max": 100968785 + } + }, + "cache_active_session_distributions": { + "cache_coverage": { + "count": 216, + "mean": 0.8506848519040607, + "median": 0.9997448273674421, + "p10": 0.43102818092852674, + "p90": 0.999982772379876, + "min": 0.0021478132287605567, + "max": 0.9999922748401895 + }, + "cache_hit_rate": { + "count": 216, + "mean": 0.8218859540276632, + "median": 0.9487389145525554, + "p10": 0.374890408374274, + "p90": 1.0, + "min": 0.0, + "max": 1.0 + }, + "cache_read_share": { + "count": 216, + "mean": 0.6788762318171216, + "median": 0.7882742441214121, + "p10": 0.15606025798620213, + "p90": 0.9641169584856126, + "min": 0.0, + "max": 0.9893885889087582 + }, + "cache_write_share": { + "count": 216, + "mean": 0.15942191032151487, + "median": 0.043386068762250346, + "p10": 0.0, + "p90": 0.5204273102542047, + "min": 0.0, + "max": 0.999839897534422 + }, + "prompt_reuse_rate": { + "count": 216, + "mean": 0.6869508630393124, + "median": 0.7947498412123791, + "p10": 0.15876630503361927, + "p90": 0.971281214123751, + "min": 0.0, + "max": 0.9914821057091003 + } + }, + "top_primary_providers": [ + [ + "omni", + 263 + ], + [ + "anthropic", + 110 + ], + [ + "pi-claude-cli", + 32 + ], + [ + "opencode", + 27 + ], + [ + "openai", + 10 + ], + [ + "nanogpt", + 9 + ], + [ + "github-copilot", + 3 + ] + ], + "top_primary_models": [ + [ + "claude-opus-4-7", + 100 + ], + [ + "claude-opus-4-8", + 77 + ], + [ + "claude-opus-4-6", + 46 + ], + [ + "opencode-zen/glm-5.1", + 41 + ], + [ + "glm-5.1", + 27 + ], + [ + "gpt-5.5-2026-04-23", + 24 + ], + [ + "claude-sonnet-4-6", + 21 + ], + [ + "gpt-5.4-2026-03-05", + 10 + ], + [ + "anthropic/claude-opus-4-7", + 10 + ], + [ + "gpt-5.5", + 9 + ] + ] +}
\ No newline at end of file |
