Skip to content

fix(ai): settle evicted PR replies, bind limiters and audit queue in chat runtimes, map auth outages to 503 - #2443

Merged
Makisuo merged 18 commits into
fix/audit-sdk-capturefrom
fix/audit-agent-runtime
Nov 10, 2026
Merged

Makisuo merged 18 commits into
fix/audit-sdk-capturefrom
fix/audit-agent-runtime

Merge branch 'fix/audit-sdk-capture' into fix/audit-agent-runtime

da8e7ed
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 10, 2026 in 2m 21s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. Auth re-mapping and the abandoned-reply settle are pinned by tests; the DO building BoundAiClients.layer is the one hop only a deploy proves.
no findings · tests covered · risk high · 1/1 new units observable

Fixes evicted PR reply turns, binds limiters/audit queue into the Durable Object runtimes, and maps an auth outage to 503; the rest is comment and instruction cleanup. Safe to merge; neither open error issue is addressed — http-graph.ts and registry.ts changed only an import and comments.

  • An evicted reply turn is settled through settleAbandonedTurn instead of left running
  • ChatSession hands aiSessionPorts to the turn and approval runtimes
  • An auth provider outage answers 503 on /mcp and the chat routes
  • Uptime tools read time_zone, maintenance windows start_time_of_day

Before merge

  • Manual · Deploy a preview: the DO now builds BoundAiClients.layer, and only a deploy proves the bindings attach

Production impact

Open errors in the changed files (3)
Issue Service Occurrences File
@maple/api/routes/VcsWebhookEnqueueFailure (2 issues) maple-api 9 apps/ai/src/runtime/http-graph.ts
@maple/mcp/errors/McpQueryError (2 issues) maple-chat 6 apps/ai/src/mcp/tools/registry.ts
@maple/mcp/errors/McpQueryError (6 issues) maple-ai 18 apps/ai/src/mcp/tools/registry.ts

After this merges, Maple checks whether they stop.

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
apps/ai/src/worker/bindings.ts 58k POST /mcp 29k/day, 0.0% err
POST /mcp 28k/day, 0.0% err
GET /mcp 373/day, 0.0% err
apps/ai/src/routes/health.ts 7.5k GET /health 5.7k/day, 0.0% err
GET /health 1.4k/day, 0.1% err
GET 310/day, 0.1% err
apps/ai/src/mcp/tool-descriptors.generated.ts 3.1k POST 1.4k/day, 0.2% err
POST 1.3k/day, 0.1% err
GET 310/day, 0.1% err
What was checked
  • Removing HealthRouter keeps /health: worker/http.ts:103 answers it before the graph builds
  • Both resolvers' error channels are exactly the three tags sessionAuthFailure catches (AuthService.ts:38,50)
  • query_data defaults to 6 hours (query-data.ts:32) and list_users/list_error_issues page by cursor, so the new guidance holds
Observability coverage: 1 of 1 changes observable
Change Kind Observable Evidence
evicted review/reply turn settled as abandoned background job (Durable Object waitUntil) yes runs inside the turn span, which annotateTurn/turnSpanAttributes marks outcome = "abandoned" (turn-runner.ts:372-382)

da8e7ed · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.