@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
20 lines • 1.54 kB
TypeScript
import { type SdkErrorClassification } from "./errors.ts";
import type { SDKMessage } from "./sdk-boundary.ts";
/** Diagnostic on the assistant message of a request that was retried at the 200k window (senpi#4065). */
export { LONG_CONTEXT_FALLBACK_DIAGNOSTIC } from "../../../provider-notices.ts";
export declare function sdkFailure(message: SDKMessage): unknown | undefined;
export declare function visibleSdkMessage(message: SDKMessage): boolean;
/**
* Only a request that asked for the legacy `[1m]` window can have that window refused. The same words
* on any other request (a native-1M model, which never sends the legacy beta) are an ordinary failure:
* never a recorded refusal, a 200k retry, or a rate limit that blocks the account (senpi#3801).
*/
export declare function classifyForRequest(error: unknown, askedLegacyLongContext: boolean): SdkErrorClassification;
/**
* The ambient lane has no account failover, so a refused 1M window is retried here: once, and only
* before anything visible streamed. Messages pass through as they arrive (system/init, api_retry and
* refusals keep their order and timing); the refused attempt is closed before the retry starts, after
* the refusal handler prepares the rebuilt options for the standard window (senpi#3408).
*/
export declare function retryAtStandardWindowOnce(attempt: () => Promise<AsyncIterable<SDKMessage>>, askedLegacyLongContext: () => boolean, onFallback: (error: unknown) => void): AsyncGenerator<SDKMessage>;
//# sourceMappingURL=long-context-retry.d.ts.map