Skip to content

Tracking: Session Limits + Codex Persistence and Signaling #28

@Camaraterie

Description

@Camaraterie

✨ Summary
Standardizes session-limit detection and surfacing, improves local/remote session signaling, and adds tests for Codex flows and session persistence. Tracks PRs #26 and #27 to land the full set safely.

🐛 Context

  • Users hit Claude’s hourly and 5-hour session limits without clear signaling.
  • Session state needed better persistence and verification across runs.
  • Goal: clearer, test-backed behavior with cross-platform confidence.

🧰 Scope

  • Session limit detection and alerting via scanner + app event.
  • Metadata/state update refinements and usage reporting.
  • Codex/MCP client tweaks and more robust test coverage.

🔗 Linked PRs

🔧 Changes (high-level)

  • src/claude/utils/sessionScanner.ts: Detects “hour limit reached” and “5-hour limit” assistant messages; emits callback.

  • src/api/apiSession.ts: Adds sendSessionLimitAlert() to notify the app; usage reporting; metadata/state update refinements.

  • src/claude/claudeLocalLauncher.ts: Wires session-limit detection to app alert.

  • Codex: Minor updates in src/codex/codexMcpClient.ts and src/codex/runCodex.ts.

  • Tests: sessionLimitDetection.test.ts, codexMcpClient.test.ts, integration.test.ts, sessionPersistence.test.ts, simpleFixVerification.test.ts.

  • Misc: Small updates in src/daemon/run.ts. .gitignore now matches main.

  • Reference commit: 0805e3a.

✅ Success Criteria

  • App logs clear session-limit events and emits session_limit_alert.
  • All added tests pass locally and in CI.
  • Verified behavior on Windows/macOS to catch watcher quirks.

🧪 How To Test

  • Unit: run pnpm test or yarn test — verify all suites pass.
  • Manual:
  1. Run a Claude session.
  2. Simulate a limit message in the session JSONL.
  3. Confirm the app logs [SESSION_LIMIT] and receives a session_limit_alert event.
Expected log snippet text [SESSION_LIMIT] hour limit reached (emitted via session_limit_alert)

⚠️ Impact / Risks

  • Low risk; changes localized to scanning/alerts and Codex tests.
  • Watch for file-watcher differences across platforms.

☑️ Checklist

🔮 Follow-ups

  • Consider an in-app banner or retry guidance for limit events.
  • Decide on telemetry for limit events (opt-in, privacy-reviewed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions