-
Notifications
You must be signed in to change notification settings - Fork 206
Description
✨ 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
- Codex session fixes: persistence, metadata.flavor, and comprehensive testing - more incoming #26
- Fix/voice naming (calling codex -> claude repeatedly) and session limit (had no indicator for claude session limit) #27
🔧 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:
- Run a Claude session.
- Simulate a limit message in the session JSONL.
- 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)- Low risk; changes localized to scanning/alerts and Codex tests.
- Watch for file-watcher differences across platforms.
☑️ Checklist
- Session-limit alert emits and is logged
- Tests green locally and on CI
- Cross-platform sanity check (Windows/macOS) [ran in WSL ✅ ]
- PRs Codex session fixes: persistence, metadata.flavor, and comprehensive testing - more incoming #26 and Fix/voice naming (calling codex -> claude repeatedly) and session limit (had no indicator for claude session limit) #27 linked to this issue
🔮 Follow-ups
- Consider an in-app banner or retry guidance for limit events.
- Decide on telemetry for limit events (opt-in, privacy-reviewed).