Skip to content

feat(usage): include bounded local OpenCode history - #886

Merged
rynfar merged 4 commits into
pylonfrom
upstream/2026-09-27-opencode-usage-history
Sep 27, 2026
Merged

rynfar merged 4 commits into
pylonfrom
upstream/2026-09-27-opencode-usage-history

Conversation

@rynfar

@rynfar rynfar commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

OpenCode task-host usage history was absent from Pylon's usage view, even though local SQLite and legacy JSON stores can hold project-level token and cost records. This adds a bounded local reader and merges its records into Pylon's existing usage cache and v8 contract while retaining v7 source attribution and existing Antigravity behavior. External OpenCode serverUrl instances remain outside this local history scan; Cursor account-wide history remains a separate maintainer decision.

The reader caps root entries, files, bytes, nested entries, and records; reports partial coverage for limits or malformed source data; and does not cache corrupt files as complete. Canonical roots and record fingerprints prevent duplicate counting. The contract retains compatibility with v7 summaries.

Verification: focused reader and shared merge tests 25/25; targeted service integration 1/1, covering SQLite/legacy JSON, duplicate roots, remote exclusion, warm/restart cache and partial status; final reader regression tests 6/6; scoped typechecks for server, contracts, shared, client-runtime, web and mobile passed; scoped lint, format and diff checks passed. An independent pre-PR adversarial review rechecked the final head and reported no high-confidence issue. The final review revision changed only the reader and its tests, so the slower service test was not repeated after that revision.

Related: #865; frozen T3 source e5a46d6c5d00b89afba5274a94d42428c8d79763 (#10409).

Model: GPT-6 Sol (low), Pylon Codex harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pylon-marketing Ignored Ignored Preview Sep 27, 2026 11:48am UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 27, 2026
@rynfar

rynfar commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

UI evidence attempt (isolated state): started this PR head with a new task-owned base directory, opened a fresh collaborative-browser tab using its one-use pairing URL, and attempted a snapshot. The preview returned PreviewAutomationExecutionError; the Vite server reported HTTP 431 (request header fields too large). No before/after image could be captured. I stopped only the task-owned dev server. The focused service and client typechecks remain the UI contract verification; this is an evidence gap, not a claim that the browser flow passed.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 14.0 KiB +20 B (+0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.3 KiB +13 B (+0.2%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +7 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB +17 B (+0.1%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB −1 B (−0.0%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB +18 B (+0.3%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.8 KiB 58.9 KiB +44 B (+0.1%) 66.4 KiB ✅
Claude Live turn messages 8 9 +1 (+12.5%) 21 ✅

Baseline: 73e5205 · PR result: 176a157 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 115.7 KiB
  • Claude decoded thread snapshot: 116.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit feeecae into pylon Sep 27, 2026
20 checks passed
@rynfar
rynfar deleted the upstream/2026-09-27-opencode-usage-history branch September 27, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant