Skip to content

Show synced context usage rings across harnesses - #264

Merged
wingleeio merged 1 commit into
mainfrom
zeron/remote-context-ring-integration
Sep 6, 2026
Merged

wingleeio merged 1 commit into
mainfrom
zeron/remote-context-ring-integration

Conversation

@wingleeio

@wingleeio wingleeio commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Adds a context ring beneath the composer for every selected conversation, including remote and project-less chats. Hover shows measured tokens and remaining capacity; the ring turns amber at 75% and red at 90%. Unknown usage is distinct from measured zero, and an open hover card updates live.

The host normalizes context separately from billing totals and persists one atomic snapshot in the chat document. Existing document sync and transcript watches carry it to other devices, including context-only updates, reconnects, and document rebuilds. Rendering needs no polling or local CLI access.

Claude Code, Codex, OpenCode, and ACP harnesses supply measurements when their protocols report them. Cursor's pinned SDK only exposes billed per-turn totals, so it shows unavailable instead of a guessed percentage.

Validation:

  • 89 document, 130 engine, and 617 UI unit tests passed.
  • Harness unit and integration suites passed; credential-dependent tests remain ignored.
  • Added an engine integration test proving post-turn compaction updates context without reopening the turn or creating transcript rows.
  • Two isolated engines through a local relay: identical 64,000/200,000 and 184,000/200,000 snapshots, post-turn compaction to zero, and viewer restart with the host stopped.
  • Native app build and git diff --check passed.

Screenshots are from the native desktop connected to the viewing engine. A separate host replayed deterministic Claude protocol fixtures through the local relay; the displayed measurements are test data.

Measured usage, dark mode:

Remote context usage

Near capacity, light mode:

Context nearing capacity

Unavailable usage:

Context usage unavailable


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

@wingleeio
wingleeio merged commit 426eb05 into main Sep 6, 2026
2 checks passed
SinaKhalili added a commit that referenced this pull request Sep 8, 2026
… screen

- AppModel decides the transport mode from the vault before any store
  dials: an explicit absent vault permits the legacy rooms, an approved
  membership with the current epoch key permits the encrypted generations,
  every other state blocks sync. Sign-out invalidates the config; the
  foreground re-checks pending approvals. Mode changes rebuild the stores.
- MobileVault, Keychain-protected VaultPersistence, the per-chat sealed
  outbox (VaultChatDisk), the registry field codec, and the encrypted
  SessionStore/ChatRoomClient/WorkspaceStore paths (outcome-bearing apply,
  paused/resume, ack-retired batches, verified-baseline registry merge).
- EncryptionView (Home → account menu): state, fingerprint, epoch, the
  genesis-bound comparison code, "Approve from another device", and
  "Use recovery key".
- Desktop/CLI expose the vault fingerprint the phone pins during pairing.
- Engine e2e: the transcript reset-frame assertion now includes the
  contextUsage field every update has carried since #264 (pre-existing
  upstream mismatch; failed identically on main).

Verification: xcodebuild simulator build succeeds; ZeronTests 104 unit +
11 UI tests pass on an iPhone 17 Pro simulator; engine e2e suite passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SinaKhalili added a commit that referenced this pull request Sep 9, 2026
… screen

- AppModel decides the transport mode from the vault before any store
  dials: an explicit absent vault permits the legacy rooms, an approved
  membership with the current epoch key permits the encrypted generations,
  every other state blocks sync. Sign-out invalidates the config; the
  foreground re-checks pending approvals. Mode changes rebuild the stores.
- MobileVault, Keychain-protected VaultPersistence, the per-chat sealed
  outbox (VaultChatDisk), the registry field codec, and the encrypted
  SessionStore/ChatRoomClient/WorkspaceStore paths (outcome-bearing apply,
  paused/resume, ack-retired batches, verified-baseline registry merge).
- EncryptionView (Home → account menu): state, fingerprint, epoch, the
  genesis-bound comparison code, "Approve from another device", and
  "Use recovery key".
- Desktop/CLI expose the vault fingerprint the phone pins during pairing.
- Engine e2e: the transcript reset-frame assertion now includes the
  contextUsage field every update has carried since #264 (pre-existing
  upstream mismatch; failed identically on main).

Verification: xcodebuild simulator build succeeds; ZeronTests 104 unit +
11 UI tests pass on an iPhone 17 Pro simulator; engine e2e suite passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants