Skip to content

fix: 6 runtime bugs from log analysis + centralize new limits#22

Merged
jsyqrt merged 1 commit intomainfrom
bugfix/runtime-log-bugfix
Apr 19, 2026
Merged

fix: 6 runtime bugs from log analysis + centralize new limits#22
jsyqrt merged 1 commit intomainfrom
bugfix/runtime-log-bugfix

Conversation

@jsyqrt
Copy link
Copy Markdown
Contributor

@jsyqrt jsyqrt commented Apr 17, 2026

Bug fixes identified from runtime-2026-04-17.log analysis:

  1. responsePromise.reject is not a function — guard deserialized mailbox items where JSON.stringify stripped resolve/reject functions; also strip responsePromise before persistence in start.ts.

  2. Heartbeat triggers false "abnormal completion" retry loop — return COMPLETION_MARKER from heartbeat case instead of undefined.

  3. LLM router thundering herd / cascade degradation — add shorter 30s circuit-breaker cooldown for 429 rate-limit errors (vs generic 5min), plus per-provider concurrency tracking with random jitter.

  4. Tool loop detector only warns but never breaks — inject warning message on any detected loop and force-break on critical severity.

  5. Browser session new_page race condition — snapshot owned page IDs before executing, add highest-ID fallback for page identification.

  6. Startup heartbeat burst — add 5s minimum initial delay and random jitter to deterministic stagger calculation.

Centralize new magic numbers (HEARTBEAT_MIN_INITIAL_DELAY_MS, HEARTBEAT_STARTUP_JITTER_MS, LLM_CIRCUIT_RESET_RATE_LIMIT_MS, LLM_MAX_CONCURRENT_PER_PROVIDER, LLM_CONCURRENCY_JITTER_BASE_MS) into packages/shared/src/limits.ts.

Made-with: Cursor

Bug fixes identified from runtime-2026-04-17.log analysis:

1. responsePromise.reject is not a function — guard deserialized
   mailbox items where JSON.stringify stripped resolve/reject functions;
   also strip responsePromise before persistence in start.ts.

2. Heartbeat triggers false "abnormal completion" retry loop — return
   COMPLETION_MARKER from heartbeat case instead of undefined.

3. LLM router thundering herd / cascade degradation — add shorter 30s
   circuit-breaker cooldown for 429 rate-limit errors (vs generic 5min),
   plus per-provider concurrency tracking with random jitter.

4. Tool loop detector only warns but never breaks — inject warning
   message on any detected loop and force-break on critical severity.

5. Browser session new_page race condition — snapshot owned page IDs
   before executing, add highest-ID fallback for page identification.

6. Startup heartbeat burst — add 5s minimum initial delay and random
   jitter to deterministic stagger calculation.

Centralize new magic numbers (HEARTBEAT_MIN_INITIAL_DELAY_MS,
HEARTBEAT_STARTUP_JITTER_MS, LLM_CIRCUIT_RESET_RATE_LIMIT_MS,
LLM_MAX_CONCURRENT_PER_PROVIDER, LLM_CONCURRENCY_JITTER_BASE_MS)
into packages/shared/src/limits.ts.

Made-with: Cursor
@jsyqrt jsyqrt merged commit 82343d3 into main Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant