limitstop

package
v0.31.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package limitstop tells, from the end of a harness's conversation record, that the agent's last turn stopped on a limit window (上限で止まった agent, #2101): the account's own limit refused the model call, and only the window's reset lets the agent go on. A server's passing rate limit, spend limits, credits and overage are not limit stops: no reset time ends them.

What each harness writes (PROTOCOL.md "Resume at reset"):

  • Claude Code: a synthetic assistant line, isApiErrorMessage, apiError usage_limit_reached, apiErrorParams.rate_limit_info {rateLimitType, resetsAt (unix s)}; the window is named.
  • Codex: event_msg task_complete (turn_complete) whose error.codex_error_info is usage_limit_exceeded; the windows are those at 100% in the token_count rate_limits before it.
  • omp: the assistant message with stopReason error and the UsageLimit bit in errorId; only the provider is told.
  • Antigravity CLI: an ERROR_MESSAGE step saying the quota ran out; only the model of the reply before it is told.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codex

type Codex struct {
	// contains filtered or unexported fields
}

Codex reads a Codex rollout as it grows; it keeps the windows of the newest token_count between reads.

func (*Codex) Feed

func (c *Codex) Feed(b []byte) (Stop, bool)

Feed reads the complete lines appended to the rollout (b) and reports the last turn among them that ended refused by a usage limit. The windows are those at 100% or more of the token_count before it (none when it told none: the account's windows say). A token_count of a workspace's credits or spend limit (rate_limit_reached_type workspace_*) makes the refusal no limit stop; one of a limit other than codex's own (limit_id) is left out.

type Stop

type Stop struct {
	// Windows are the windows that ran out, with their reset, when the
	// record names them (Claude Code, Codex).
	Windows []usage.Window
	// Provider is omp's provider of the refused reply ("anthropic",
	// "openai-codex"): the account whose windows ran out.
	Provider string
	// Model is the model Antigravity CLI ran last: it names the quota
	// group whose windows ran out.
	Model string
}

Stop is a limit stop as the record tells it.

func Antigravity

func Antigravity(tail []byte) (Stop, bool)

Antigravity reads the end of an Antigravity CLI transcript: its last step (Antigravity CLI's own notes aside) is an ERROR_MESSAGE about the quota. Model is the model of the last reply before it, if the tail has one.

func Claude

func Claude(tail []byte) (Stop, bool)

Claude reads the end of a Claude Code transcript: its last user or assistant line is the API error of a limit the account reached, with a window of five_hour, seven_day or seven_day_<model> and its reset.

func Omp

func Omp(tail []byte) (Stop, bool)

Omp reads the end of an omp session file: its last message is an assistant reply that stopped on an error with the UsageLimit bit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL