style: applied biome formatting after community fix merges
This commit is contained in:
@@ -27,9 +27,7 @@ const SUBSCRIPTION_CAP_PATTERN =
|
||||
const TRANSIENT_INTERVAL_RATE_LIMIT_PATTERN = /\bper\s+(?:second|minute)\b/i;
|
||||
|
||||
function matchesSubscriptionCapText(errorMessage: string): boolean {
|
||||
return (
|
||||
SUBSCRIPTION_CAP_PATTERN.test(errorMessage) && !TRANSIENT_INTERVAL_RATE_LIMIT_PATTERN.test(errorMessage)
|
||||
);
|
||||
return SUBSCRIPTION_CAP_PATTERN.test(errorMessage) && !TRANSIENT_INTERVAL_RATE_LIMIT_PATTERN.test(errorMessage);
|
||||
}
|
||||
const OPENROUTER_DAILY_FREE_LIMIT_PATTERN = /\bfree[-_ ]models[-_ ]per[-_ ]day\b/i;
|
||||
// gRPC/Connect end-streams carry the status as its name (`resource_exhausted`),
|
||||
@@ -67,8 +65,7 @@ const CN_TRANSIENT_CAP_PATTERN =
|
||||
// Common Simplified Chinese throttle phrasing. Consulted by
|
||||
// isOpaqueStatusBody so CN transients stay in the provider backoff lane instead
|
||||
// of rotating through the opaque-429 fallback.
|
||||
const CN_THROTTLE_PATTERN =
|
||||
/速率(?:限制|过快)|频率(?:过高|过快)|过于频繁|稍后[重再]试/;
|
||||
const CN_THROTTLE_PATTERN = /速率(?:限制|过快)|频率(?:过高|过快)|过于频繁|稍后[重再]试/;
|
||||
|
||||
/**
|
||||
* Classify a rate-limit error message into a reason category.
|
||||
|
||||
@@ -292,7 +292,8 @@ export class InputController {
|
||||
this.ctx.ui.addInputListener(data => {
|
||||
if (!this.ctx.keybindings.matches(data, "app.tools.expand")) return undefined;
|
||||
if (this.ctx.ui.hasOverlay()) return undefined;
|
||||
if (this.ctx.ui.getFocused() instanceof TreeSelectorComponent && matchesKey(data, "ctrl+o")) return undefined;
|
||||
if (this.ctx.ui.getFocused() instanceof TreeSelectorComponent && matchesKey(data, "ctrl+o"))
|
||||
return undefined;
|
||||
this.toggleToolOutputExpansion();
|
||||
return { consume: true };
|
||||
});
|
||||
|
||||
@@ -747,7 +747,15 @@ describe("InputController global tool-output expand (ctrl+o)", () => {
|
||||
children: [],
|
||||
},
|
||||
] as unknown as SessionTreeNode[];
|
||||
context.setFocused(new TreeSelectorComponent(tree, "root", 20, () => {}, () => {}));
|
||||
context.setFocused(
|
||||
new TreeSelectorComponent(
|
||||
tree,
|
||||
"root",
|
||||
20,
|
||||
() => {},
|
||||
() => {},
|
||||
),
|
||||
);
|
||||
|
||||
expect(dispatchInput(listeners, "\x18")).toEqual({ consume: true });
|
||||
expect(context.ctx.toolOutputExpanded).toBe(true);
|
||||
|
||||
@@ -26,7 +26,12 @@ afterAll(() => {
|
||||
});
|
||||
|
||||
/** Minimal SegmentContext factory — only path/git fields matter for these tests. */
|
||||
function createCtx(overrides?: { pathMaxLength?: number; branch?: string | null; sessionName?: string; sessionAccent?: boolean }): SegmentContext {
|
||||
function createCtx(overrides?: {
|
||||
pathMaxLength?: number;
|
||||
branch?: string | null;
|
||||
sessionName?: string;
|
||||
sessionAccent?: boolean;
|
||||
}): SegmentContext {
|
||||
const hasName = overrides?.sessionName !== undefined;
|
||||
return {
|
||||
session: {
|
||||
|
||||
@@ -126,7 +126,15 @@ export function parseFrontmatter(
|
||||
content: string,
|
||||
options?: FrontmatterOptions,
|
||||
): { frontmatter: Record<string, unknown>; body: string } {
|
||||
const { location, source, fallback, normalize = true, level = "warn", repair = true, rawKeys = false } = options ?? {};
|
||||
const {
|
||||
location,
|
||||
source,
|
||||
fallback,
|
||||
normalize = true,
|
||||
level = "warn",
|
||||
repair = true,
|
||||
rawKeys = false,
|
||||
} = options ?? {};
|
||||
const finalizeKeys = (fm: Record<string, unknown>): Record<string, unknown> =>
|
||||
rawKeys ? fm : normalizeFrontmatterKeys(fm);
|
||||
const loc = location ?? source;
|
||||
|
||||
Reference in New Issue
Block a user