Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: narrow usage-limit kind slot and keep reset clock on one line
[._.]/ Adam Eivy3a59a5ead8a2
diff --git a/server/lib/aiToolkit/errorDetection.js b/server/lib/aiToolkit/errorDetection.jsindex c993ce738c..1bb0273c79 100644--- a/server/lib/aiToolkit/errorDetection.js+++ b/server/lib/aiToolkit/errorDetection.js@@ -144,10 +144,13 @@ const ERROR_PATTERNS = [// phrase story text can legitimately contain, and this scan reads the// model's entire screen.//- // `hit your (<word> ){1,2}limit` is ONE alternative covering the whole- // banner family rather than an enumeration of limit kinds, because the kind- // and the separator both vary and an enumeration kept missing live wordings.- // At least one kind word is REQUIRED: every real banner names the kind+ // `hit your [<modifier> ]<kind> limit` is ONE alternative covering the whole+ // banner family regardless of separator. The kind slot is a closed+ // vocabulary (session, usage, weekly, monthly, daily, hourly, spend, N-hour)+ // with one optional leading modifier (a model name, `monthly spend`): an+ // open `<word> limit` slot matched `hit your tool call limit` in tool logs+ // and file contents, which would bench a healthy provider. A new CLI kind+ // needs one word added here. At least one kind word is REQUIRED: every real banner names the kind// (`session`, `usage`, `weekly`, `5-hour`, `monthly spend`, `Opus usage`),// while a bare `hit your limit` is reachable by ordinary prose — "he had// hit your limit of patience" matched when the kind was optional.@@ -161,7 +164,7 @@ const ERROR_PATTERNS = [// `5-hour`/`weekly`/`Opus` kinds the CLI also emits were missing for the// same reason. Anchored on the second-person `hit your … limit` so the// bound wildcard cannot be reached by prose about a limit.- pattern: /(?:hit your (?:[\w-]+ ){1,2}limit\b|usage limit|Upgrade to Pro|upgrade your subscription to increase your limits|(?:^|\n)\s*(?:\[stderr\]\s*)?Now using extra usage\s*(?:\r?\n|$))/i,+ pattern: /(?:hit your (?:[\w-]+ )?(?:session|usage|weekly|monthly|daily|hourly|spend|\d+-hour) limit\b|usage limit|Upgrade to Pro|upgrade your subscription to increase your limits|(?:^|\n)\s*(?:\[stderr\]\s*)?Now using extra usage\s*(?:\r?\n|$))/i,category: ERROR_CATEGORIES.USAGE_LIMIT,requiresFallback: true,actionable: true,@@ -264,7 +267,7 @@ const WAIT_TIME_PATTERNS = [// of a DURATION phrased off `resets` (`resets 5 minutes from now` → `5`),// which the general duration scan below reads correctly as `5 minutes`.// `resets in 3h51m14s` has no digit after `resets` and falls through either way.- /resets?\s+(\d{1,2}(?::\d{2})?\s*(?:am|pm)|\d{1,2}:\d{2})\s*(?:\(([^)]+)\))?/i,+ /resets?\s+(\d{1,2}(?::\d{2})?[ \t]*(?:am|pm)\b|\d{1,2}:\d{2})[ \t]*(?:\(([^)]+)\))?/i,/try again in\s+((?:\d+\s*(?:day|hour|minute|second)s?\s*)+)/i,/wait\s+((?:\d+\s*(?:day|hour|minute|second)s?\s*)+)/i,/in\s+(\d+)\s*(day|hour|minute|second)s?/i,diff --git a/server/lib/aiToolkit/errorDetection.test.js b/server/lib/aiToolkit/errorDetection.test.jsindex 13b569d0df..bab1097d49 100644--- a/server/lib/aiToolkit/errorDetection.test.js+++ b/server/lib/aiToolkit/errorDetection.test.js@@ -144,6 +144,8 @@ describe('Error Detection', () => {it.each([['prose about reaching a personal limit', 'He had hit your limit of patience, the narrator wrote.'],['prose naming an unrelated limit', 'The hero hit your father with a limit break attack'],+ ['a tool call limit in a tool log', "Error: you hit your tool call limit for this turn"],+ ['a context window limit in file content', 'if (used > max) throw new Error("hit your context window limit")'],])('does not classify %s as a usage limit', (_label, text) => {expect(analyzeError(text, 1).category).not.toBe(ERROR_CATEGORIES.USAGE_LIMIT);});@@ -882,6 +884,14 @@ describe('Error Detection', () => {expect(extractWaitTime(text)).toBe(expected);});+ // The clock must not cross a line for its zone, nor take `am` out of a word.+ it.each([+ ['a zone on the next TUI line', 'resets 12:40am\n(see docs)', '12:40am'],+ ['a meridiem prefix of a longer word', 'resets 5 amounts', null],+ ])('does not over-capture %s', (_label, text, expected) => {+ expect(extractWaitTime(text)).toBe(expected);+ });+it('should return null for no time found', () => {const result = extractWaitTime('No time information here');expect(result).toBeNull();