Skip to content

fix: stabilize session history and recovery, add Claude quota refresh - #52

Merged
muggle-stack merged 3 commits into
masterfrom
fix/session-recovery-claude-usage
Sep 29, 2026
Merged

muggle-stack merged 3 commits into
masterfrom
fix/session-recovery-claude-usage

Conversation

@muggle-stack

Copy link
Copy Markdown
Owner

Long turns, steering and reconnects could lose or reorder visible history, leave completed Claude input marked as running, or discard rejected input. Claude quota also stayed empty until a model response emitted a native usage event.

This change preserves message and terminal identities through replay and recovery, retains rejected payloads for manual retry, and adds optional account-scoped quota reads without sending a model prompt.

Changes

  • Preserve long-turn output, paged process details and side-chat user boundaries while history hydrates and live events continue.
  • Match Claude completion to consumed human input, recover sessions only after a proven service restart, and preserve Codex steering boundaries.
  • Keep rejected sends private and retryable; restore local file preview links; ignore cost-only Claude transcript growth.
  • Refresh Claude quota on focus/reconnect, meter open/manual refresh and visible-page polling. Coalesce reads per account, retain valid cached observations on failures and distinguish missing helper configuration from failed queries.

Deployment notes

The Claude service terminal-receipt fix requires the documented service drain upgrade; a Wrapper-only restart does not change an existing service owner. Accepted inputs must not be replayed.

Active quota reads require an operator-owned helper configured outside the repository. Provider adapters and credentials are not bundled. Without a helper, native quota events continue to work. The wire protocol remains v72.

Validation

  • .venv/bin/python -m pytest: 5,195 passed, 4 skipped (two Linux-only checks, optional fzf, and the opt-in live-model scenario).
  • uvx --from ruff==0.15.13 ruff check cc_remote tests deploy: passed.
  • Node 24.21.0: Web build, reliability tests and lint all passed; bundle budget passed.
  • bash -n and shellcheck -x on the required deployment scripts: passed.
  • Protocol bundle validation and git diff --check (including the complete PR diff): passed.
  • The consolidated commit tree exactly matches the previously validated source; the worktree is clean. No live model calls were made for this gate.

The macOS test subprocess environment excludes inherited XPC_SERVICE_NAME so process-ownership checks do not mistake the test runner for its launcher service.

- Restore public Codex messages, source clocks and bounded long-turn detail pages.
- Preserve side-chat user boundaries and complete item snapshots across replay.
- Load open process details reliably and retain live output during hydration.
- Match Claude terminal receipts to consumed human inputs with service compatibility.
- Cover history, replay, cursor boundaries and completion routing with regressions.
- Recover old Claude sessions after a proven service restart without replaying accepted input.
- Keep rejected sends private and preserve their complete payload for manual retry.
- Preserve Codex steering boundaries and native user-message identities.
- Ignore Claude cost-only transcript growth and project unified quota windows.
- Restore local file preview links and guide Claude to the authenticated viewer.
- Validate the deployed snapshot with 5181 tests passing, 4 expected skips, and the local Web and shell checks.
- Read account-scoped usage through private provider-owned helpers without copying credentials.
- Coalesce active reads and preserve newer native events and valid cached quota on failures.
- Refresh Claude quota on focus, reconnect, opening the meter and visible-page polling.
- Distinguish missing helper configuration from failed quota reads.
- Cover helper boundaries, percentage units, concurrency and failure presentation.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@muggle-stack

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T04:48:33.037492Z ab05586 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ab05586b5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@muggle-stack
muggle-stack merged commit b716a3a into master Sep 29, 2026
2 checks passed
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