Chat: the server continues a usage-refused Claude chat at the reset
When Claude Code refuses an operator chat's turn for a usage limit and the server does not continue it on another account, the server now queues a durable prompt (auto-continue-<refusal id>, sent as Pipelines (automatic)) for a minute after the reset: the refused operator message when the turn did no work, else "continue". The reset comes from the refusal's text, else the rejected rate_limit_event. Refusals of turns Claude Code started itself are handled too, with no client attached; a restarted server or a device scheduling the same refusal adds nothing. The choice is kept per Claude home beside auto-switch (or by the server for chats without one), read and set with chat_auto_continue, on by default. The app's limit banner now finds the refusal as the latest turn, ignoring notices, agent reports and activity rows after it, reads and writes the server's choice, and only schedules its own prompt for older servers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+25
-4
@@ -584,12 +584,12 @@ queues into the chat, behind the refused turn, a prompt sent as
|
||||
`Pipelines (automatic)` and starting `[Sent automatically by Pipelines]` that
|
||||
names both accounts and asks the agent to check its progress against the
|
||||
request and its plan, and to stop and ask if it is off track, before it
|
||||
continues. The app's `auto-continue-<refusal id>` prompt for that refusal is
|
||||
removed from the queue (and refused if it arrives later), and the operator gets
|
||||
continues. Any `auto-continue-<refusal id>` prompt waiting in the queue is
|
||||
removed (and one arriving later is refused), and the operator gets
|
||||
a low-priority notification "Switched <chat> to <email> and continued". Each
|
||||
refusal switches at most once; a refusal of the new account tries the next
|
||||
untried account; with none left nothing more happens and auto-continue at the
|
||||
reset applies. It is on by default and is a per-Claude-home choice kept in
|
||||
untried account; with none left auto-continue at the reset applies. It is on by
|
||||
default and is a per-Claude-home choice kept in
|
||||
`<config dir>/pipelines-accounts/settings.json`: `claude_account_auto_switch`
|
||||
(body `claude_account: {"session_id", "auto_switch": bool}`) sets it, every
|
||||
`claude_accounts` reply reports it as `auto_switch`, and
|
||||
@@ -597,6 +597,27 @@ reset applies. It is on by default and is a per-Claude-home choice kept in
|
||||
not switched: a stage refused for usage fails with the provider-quota error and
|
||||
its run stops.
|
||||
|
||||
Auto-continue at the reset: when such a refusal was not continued on another
|
||||
account (switching off, no account left, or no Claude home of its own), the
|
||||
server queues a durable prompt into the chat, sent as `Pipelines (automatic)`
|
||||
with operation id `auto-continue-<refusal message id>` and `send_at` one minute
|
||||
after the reset. The reset is the one the refusal's text names ("resets 7:20pm
|
||||
(Europe/London)", or the older `usage limit reached|<epoch>`), else the
|
||||
rejected `rate_limit_event`'s `resetsAt`; a refusal naming neither is not
|
||||
continued. The prompt is the refused operator message again when the refused
|
||||
turn was that message and did no work, else `continue` (also for turns Claude
|
||||
Code started itself, such as background-task notifications). The refusal is
|
||||
handled when the server reads it, whether or not a client is attached; one
|
||||
already scheduled, by the server or by a device, is not scheduled again, and a
|
||||
prompt still waiting from an earlier refusal is kept rather than joined by a
|
||||
second. It waits in the queue as a scheduled prompt any client can remove.
|
||||
The choice ("Auto-continue when limits reset", on by default) is read and set
|
||||
with `chat_auto_continue` (body and reply `chat_auto_continue: {"session_id",
|
||||
"auto_continue": bool, "scope"}`; omit `auto_continue` to read it). It is kept
|
||||
per Claude home as `auto_continue` beside `auto_switch` (scope `claude_home`),
|
||||
or by the server in its settings table for a chat without one (scope
|
||||
`server`).
|
||||
|
||||
The brokered OpenCode chat exposes the operator's own sessions, separate from the
|
||||
sessions pipeline runs create. The protocol types are:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user