Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Improve API error handling and robustness

9 months ago

8b1bf2c
Authored
mweinbach2/12/2026, 12:17:45 AM
Add numerous reliability, error-handling, and robustness fixes across the project:

- CI/workflows: move provider secret envs into specific steps and add empty permissions to claude.yml.
- Docs: update AGENTS.md with guidance for subagents and tweak runbook wording.
- API routes: wrap observability, snapshot, runs, and run detail endpoints in try/catch and return 500s on failure; sanitize list/stream limits.
- Streaming: hoist timers, add ReadableStream.cancel to clear intervals and avoid leaks; improve heartbeat handling.
- Portal dashboard: import React explicitly, add EventSource retry logic, support aborting in-flight queries, show placeholders while loading, and improve sent-message ID trimming and input normalization.
- Observability: batch endpoint health scoring, fix query timeout/timer ordering, drain trace export responses, and parallelize SLO query evaluation; add exhaustive default in SLO compare.
- Runtime: add command timeout with SIGKILL to prevent hanging child processes.
- Server: strengthen client message validation in protocol; log warnings for unknown ask/approval responses and preserve initial message when trimming history; use void for async fire-and-forget send.
- Misc: regex fix for retryDelay extraction in scripts and various config refactors to use safer property access and defaults.

These changes are intended to reduce crashes, resource leaks, and surprising behaviors during normal operation and CI runs.

Parent904e81a

21 files changed
  • .github/workflows/ci.yml+10−5
  • .github/workflows/claude.yml+2−0
  • AGENTS.md+3−1
  • apps/portal/app/api/observability/query/route.ts+6−2
  • apps/portal/app/api/observability/snapshot/route.ts+6−2
  • apps/portal/app/api/runs/detail/route.ts+8−5
  • apps/portal/app/api/runs/route.ts+7−3
  • apps/portal/app/api/stream/runs/route.ts
+11
−3
  • apps/portal/components/dashboard.tsx+24−5
  • apps/portal/lib/observability.ts+5−5
  • docs/harness/runbook.md+0−1
  • scripts/run_raw_agent_loops.ts+1−1
  • src/config.ts+10−12
  • src/observability/otel.ts+8−4
  • src/observability/query.ts+1−1
  • src/observability/runtime.ts+18−1
  • src/observability/slo.ts+19−14
  • src/server/protocol.ts+29−7
  • src/server/session.ts+11−5
  • src/server/startServer.ts+1−1
  • src/tui/index.tsx+10−2