Skip to content

fix: let fake-claude sessions continue after a usage limit resets - #64

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/31-look-into-https-github-com-hyperstructur
Oct 18, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/31-look-into-https-github-com-hyperstructur

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

fake-claude hits its usage limit whenever a turn says limit. When a pause ends, fctl-agent continues the session with "The usage limit has reset. Continue where you left off." (on_tick in crates/fctl-agent/src/supervisor.rs), and that sentence says limit too. So in cargo xtask dev a limit session hit the limit again each time it resumed and paused for another 50 seconds, until someone stopped it. Since #58, each of those reports also flipped the credential's five-hour reading to "used up".

Now a turn asks for the limit only when it says limit but not reset. The agent's message gets the usual answer, so a limit session pauses once, resumes after the reset and answers. The rule is written in fake-claude's module docs and in docs/development.md. Nothing that ships to hosts or the control plane changes.

I matched on reset rather than on the agent's exact sentence so that rewording the sentence doesn't bring the loop back, as long as it still says the limit has reset. A message you type with both limit and reset in it now gets a normal answer too; the docs say so.

Verification

  • cargo test -p fake-claude: a new test covers the rule (limit hits it in any case; the agent's sentence and a turn without limit don't).

  • cargo xtask check passes.

  • cargo xtask dev, then fctl run -p playground "limit". From fctl logs playground#1 --json:

    13:10:01 user_message "limit"
    13:10:01 rate_limit_event rejected five_hour
    13:10:01 status paused "Waiting for the usage limit to reset"
    13:10:01 result error_during_execution
    13:10:51 status running "Resuming after the usage limit reset"
    13:10:51 rate_limit_event allowed five_hour 72%, seven_day 40%
    13:10:52 assistant "I'll take a look at that. You asked: \"The usage limit has reset. …"
    13:10:52 assistant tool_use Bash "ls -la"
    13:10:52 result success
    13:10:52 status idle "Waiting for a message"
    

    It didn't pause again in the two minutes that followed (before the fix it paused again within the same second it resumed, as the issue's transcript shows). fctl claude status showed "5-hour limit 72% used", reported by the turn that resumed.

  • fctl send playground#1 "limit again" then paused the session again, so limit still works later in a session. "hello while paused", sent during that pause, got its answer after the reset.

That last run also showed the session going idle before fake-claude answered the waiting message. fake-claude doesn't report queued_turn_count in its result, and fctl-agent reads that field to keep a session running. I opened #63 for it; it's left out of this change.

Fixes #59

Session: https://app.fctl.sh/s/ses_01M57HNYYJMEMYHPRKXVQPDN13

fake-claude took "The usage limit has reset. Continue where you left
off.", which fctl-agent sends when a pause ends, as a request to hit the
limit, so a limit session in cargo xtask dev paused again every 50
seconds. A turn now asks for the limit only if it says limit but not
reset.

Refs #59
@kalaspuff
kalaspuff merged commit 1d81e66 into main Oct 18, 2026
4 checks passed
@kalaspuff
kalaspuff deleted the fctl/31-look-into-https-github-com-hyperstructur branch October 18, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

fake-claude hits its usage limit again every time the session resumes

1 participant