Cloud deployment add agent health monitoring and auto restart on crash#417
Open
clintjeff2 wants to merge 2 commits into
Conversation
…d-auto-restart Add agent health monitoring and degraded-state reporting
|
Contributor
Author
|
@leocagli, review and merge. |
1 similar comment
Contributor
Author
|
@leocagli, review and merge. |
Contributor
Author
|
@leocagli, please review and merge. |
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.



Motivation
Description
lib/agents/agent-error-store.tsthat records invocation errors to./.data/agent-errors.json, exposesrecordAgentExecutionError,recordAgentExecutionSuccess,recordAgentInvocation,getAgentErrorCount24h, andgetAgentHealthSummary, and marks an agent degraded after 3 consecutive failures.app/agent-functions/[id]/route.ts,lib/agent-runtime/agent.ts,lib/agent-runtime/cloud-agents.ts) so degraded agents remain callable, log a warning, and surface adegradedboolean.GET /api/admin/agents/[id]/healththat returns{ agentId, status, lastSeen, errorCount24h, degraded }(app/api/admin/agents/[id]/health/route.ts).errorCount24handdegradedfromapp/api/registry/route.tsand showing a degraded badge + Errors 24h inapp/registry/page.tsx.__tests__/agent-error-store.test.ts).Testing
npx vitest run __tests__/agent-error-store.test.ts __tests__/api/registry/registry.test.ts __tests__/api/agents/health.test.tsand all tests passed (3 files, 16 tests passed).npx tsc --noEmitreported failures unrelated to these changes due to missing optional dependencies (lru-cache,@wagmi/connectors) in the workspace.npm run buildwas attempted but blocked by external Google Fonts fetch failures during the Next.js build (network/font fetching issue) and not by the new code.Closes #198