feat: add service:core error pattern fixes#125
Open
icehippo wants to merge 2 commits intoHKUDS:mainfrom
Open
Conversation
Phase 0-5: AI dev team OS with per-project-type pipelines, dashboard UI, Jira/Datadog integration, E2E test infra, Second Brain knowledge store. Bug fixes from dual review pipeline: - Fix dual workflow identity in ProjectManager - Fix mailbox cross-consume (peek first) - Fix stale context cache on stage transition - Fix zombie process on health check failure - Unify stage prompts, add body size limit - Optimize N+1 query, add threading.Lock
Address 81% of daily production errors (466/24h): - P0 (63%): FallbackChain with exponential backoff retry for llm.sub_agent.fallback.failed - P1 (18%): SafeContextBuilder with required field validation for memory_context_preparation_failed - P2 (6%): MemoryGuard with RSS monitoring and chunked processing for Worker SIGKILL OOM Includes 52 tests (failure ratio 62%+).
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.
Summary
FallbackChainwith exponential backoff retry forllm.sub_agent.fallback.failed. Configurableretryable_exceptionsprevents retrying non-recoverable errors (auth, config).SafeContextBuilderwith required field validation and graceful degradation (build_partial()) formemory_context_preparation_failed. Duplicate field detection prevents silent data loss.MemoryGuardwith actual RSS monitoring via/proc/self/status(Linux) and chunked batch processing with GC hints for Worker SIGKILL OOM.Addresses 81% of daily production errors (466 errors/24h, service:core env:prd).
Changes
clawteam/fixes/exceptions.pyCoreServiceError,SubAgentFallbackExhaustedError,MemoryContextPreparationError,WorkerMemoryLimitExceededErrorclawteam/fixes/fallback_retry.pyRetryConfigvalue object +retry_with_backoff+FallbackChainclawteam/fixes/memory_context.pyContextFieldvalue object +SafeContextBuilderfactoryclawteam/fixes/worker_memory.pyMemoryGuardwith RSS check +chunked_processorTest plan