fix: 6 runtime bugs from log analysis + centralize new limits#22
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes identified from runtime-2026-04-17.log analysis:
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.
Heartbeat triggers false "abnormal completion" retry loop — return COMPLETION_MARKER from heartbeat case instead of undefined.
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.
Tool loop detector only warns but never breaks — inject warning message on any detected loop and force-break on critical severity.
Browser session new_page race condition — snapshot owned page IDs before executing, add highest-ID fallback for page identification.
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