fix(web-ui): surface core session limit#1860
Conversation
|
Added browser verification screenshot for the session-limit UI state. Test setup:
Screenshot: |
bassilkhilo-ag2
left a comment
There was a problem hiding this comment.
✅ Clean. detect_core_session_limit() handles both typographic and straight apostrophe in the session-limit string, 0.75s tmux timeout is safe, triple-call dedup (status file + /core-status + /tasks/active) is right. Tests cover both positive and negative cases. Approve.
bassilkhilo-ag2
left a comment
There was a problem hiding this comment.
Good approach for surfacing an otherwise-invisible failure mode. The 0.75s timeout on tmux capture-pane is tight enough to not block the /core-status poll, and the regex covers both straight apostrophe and Unicode right-single-quote (the form Claude Code renders). Injecting core_limit into the core-status response is non-breaking since callers that do not expect the field will ignore it. The three code paths (status file exists + parseable, exists + unreadable, missing) all get the same augmentation. ✓
bassilkhilo-ag2
left a comment
There was a problem hiding this comment.
Solid approach. The regex handles both smart and straight apostrophes, the 0.75s tmux timeout is fail-open (except Exception: text = ''), and the core_limit field is correctly propagated through /core-status and /tasks. UX improvement: users see the reset time instead of a spurious 'brain offline'. LGTM.

Summary
A simple web UI question can sit in
workingeven when the task bridge and web UI are healthy ifsutando-coreis blocked by Claude Code's session limit. Today/tasks/activereportsclaude: truebased only on the process existing, so the UI looks alive but gives no reason that replies are queued.This PR surfaces that blocked state:
agent-api.pydetects the Claude Code pane textYou've hit your session limit ... resets ...from thesutando-coretmux session./tasks/activeincludescore_limitfor the dashboard status line./core-statusoverrides the status step withClaude session limit reached; resets ...while the core is quota-blocked.brain offline/Core: working.Why
Live repro on 2026-06-30: a web UI task
are you able to create video?was created at 09:08:03 PDT and stayedworkingfor several minutes. The core pane showed:You've hit your session limit - resets 9:50am (America/Los_Angeles)The UI had no way to communicate that reset time.
Test plan
python3 tests/agent-api-core-limit.test.pynpx tsx --test tests/web-client-core-limit-status.test.tspython3 -m py_compile src/agent-api.py tests/agent-api-core-limit.test.pynpm run typecheckgit diff --checkNotes
This does not bypass the Claude session limit. It only makes the blocked state visible so queued web UI tasks do not look like mysterious silence.