Skip to content

[codex] Add session lane and lock diagnostics#2

Open
brian-chenyang wants to merge 2 commits into
v2026.3.9-fix-by-kevin-20260403from
codex/session-lock-diagnostics-v2026039
Open

[codex] Add session lane and lock diagnostics#2
brian-chenyang wants to merge 2 commits into
v2026.3.9-fix-by-kevin-20260403from
codex/session-lock-diagnostics-v2026039

Conversation

@brian-chenyang

Copy link
Copy Markdown

Summary

Adds production-safe diagnostics on top of the current v2026.3.9-fix-by-kevin-20260403 OpenClaw branch.

  • Extends lane snapshots from main-only to include active session:* lanes, with laneType, active, queued, peakActiveLast30s, depth, and oldestQueuedMs.
  • Adds session file lock diagnostics for slow acquisition, timeout, and long-held lock release.
  • Adds focused tests for session lane snapshots and lock diagnostic events.

Why

OpenMAI incidents showed main lane was not saturated, while user-facing failures correlated with long session-lane waits, provider timeouts, and containers.json.lock contention. The previous logs could not distinguish whether the lock was held too long, waited on too long, or merely failed at the end of a long task.

Validation

  • pnpm exec vitest run --config vitest.unit.config.ts src/process/command-queue.test.ts
  • pnpm exec vitest run src/agents/session-write-lock.test.ts
  • pnpm format:check src/process/command-queue.ts src/process/command-queue.test.ts src/logging/diagnostic.ts src/infra/diagnostic-events.ts src/agents/session-write-lock.ts src/agents/session-write-lock.test.ts
  • pnpm exec oxlint --type-aware src/process/command-queue.ts src/process/command-queue.test.ts src/logging/diagnostic.ts src/infra/diagnostic-events.ts src/agents/session-write-lock.ts src/agents/session-write-lock.test.ts
  • pnpm build

@brian-chenyang
brian-chenyang marked this pull request as ready for review May 18, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant