mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* fix(pi): add get_session_stats fallback from get_state for old OMP binaries Older Oh My Pi binaries don't support the get_session_stats RPC command, leaving session usage stats blank in Paseo. This adds a compat layer in cli-runtime.ts where getSessionStats() tries get_session_stats first, then falls back to extracting context window usage from get_state. The fallback provides contextUsage.tokens and contextWindow even when the binary lacks full token/cost reporting — enough to keep the context meter working. Token counts and cost still require the newer RPC. Added three tests: - Fallback triggers when get_session_stats is unsupported (throws) - No fallback when get_session_stats returns valid data - Returns empty object when both commands fail * fix(pi): use nullish check instead of truthy for cost field in getSessionStats