Skip to content

Fix stale diagnostic lanes for reply runs - #81302

Merged
obviyus merged 3 commits into
mainfrom
codex/fix-80677-diagnostic-lanes
May 13, 2026
Merged

obviyus merged 3 commits into
mainfrom
codex/fix-80677-diagnostic-lanes

Conversation

@obviyus

@obviyus obviyus commented May 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Track active reply runs in diagnostic activity so queued Telegram lanes are not mistaken for idle/stuck work.
  • Clear stale queued diagnostic state after noop/no_active_work recovery.
  • Add regressions for reply-run diagnostic visibility and no-active-work queue cleanup.

Real behavior proof

  • Behavior or issue addressed: queued Telegram reply lanes could look stuck because diagnostics saw queued work without the active reply run, and no-active-work recovery could leave stale queueDepth=1 state.
  • Real environment tested: local OpenClaw gateway from this branch, real Telegram bot-to-bot group transport, real SUT Telegram bot, mock OpenAI-compatible SSE model server.
  • Exact steps or command run after this patch: node /Users/obviyus/.codex/skills/custom/telegram-e2e-bot-to-bot/scripts/run-mock-sut-e2e.mjs --text '@{sut} Please answer with OPENCLAW_E2E_OK only for diagnostic lane PR proof {run}.' --expect OPENCLAW_E2E_OK --timeout-ms 90000 --output /tmp/openclaw-80677-pr-bot-to-bot.json
  • Evidence after fix (terminal capture):
sent.messageId=7651 text="@foremanclawbot Please answer with OPENCLAW_E2E_OK only for diagnostic lane PR proof QA-mp3lgbjd."
reply.messageId=7652 fromUsername=foremanclawbot replyToMessageId=7651 text="OPENCLAW_E2E_OK"
observedCount=1 rttMs=6865 mockRequests=1 drained.pendingBefore=0 drained.drained=0 drained.pendingAfter=0
  • Observed result after fix: the live Telegram lane replied normally and threaded to the triggering message. In the queued stress run, two delayed same-lane Telegram messages both returned threaded replies while diagnostics reported active work with queueDepth=1; no session.stuck and no queued_work_without_active_run were emitted.
  • What was not tested: a full production provider compaction overflow was not separately forced; the root diagnostic states were covered by regression tests and the real Telegram queued-lane run.

Verification

  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/logging/diagnostic.test.ts src/logging/diagnostic-stuck-session-recovery.runtime.test.ts src/auto-reply/reply/reply-run-registry.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/logging/diagnostic-run-activity.ts src/logging/diagnostic-session-recovery.ts src/logging/diagnostic-session-recovery-coordinator.ts src/logging/diagnostic.test.ts src/auto-reply/reply/reply-run-registry.ts src/auto-reply/reply/reply-run-registry.test.ts
  • git diff --check origin/main...HEAD
  • OPENCLAW_LOCAL_CHECK_MODE=throttled pnpm check:changed --timed

Fixes #80677.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels May 13, 2026
@obviyus obviyus self-assigned this May 13, 2026
@clawsweeper

clawsweeper Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
Review failed before ClawSweeper could summarize the requested change.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Real behavior proof
Not applicable: Real behavior proof was not assessed because the Codex review failed.

Next step before merge
Review did not complete, so no work-lane recommendation was made.

Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

Do we have a high-confidence way to reproduce the issue?

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Command failed: /usr/bin/git status --porcelain=v1 --untracked-files=all.
  • codex stdout: Per-item Codex failure; continuing with the rest of the shard.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)

Remaining risk / open question:

  • No close action taken because the review did not complete.

Codex review notes: model gpt-5.5, reasoning high; reviewed against b25f6573946b.

@obviyus
obviyus force-pushed the codex/fix-80677-diagnostic-lanes branch from b0525ff to d929e2a Compare May 13, 2026 05:12
@obviyus
obviyus merged commit 8fe196e into main May 13, 2026
111 checks passed
@obviyus
obviyus deleted the codex/fix-80677-diagnostic-lanes branch May 13, 2026 05:18
@obviyus

obviyus commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Landed via rebase onto main.

  • Scoped tests: OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/logging/diagnostic.test.ts src/logging/diagnostic-stuck-session-recovery.runtime.test.ts src/auto-reply/reply/reply-run-registry.test.ts
  • Format/checks: pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/logging/diagnostic-run-activity.ts src/logging/diagnostic-session-recovery.ts src/logging/diagnostic-session-recovery-coordinator.ts src/logging/diagnostic.test.ts src/auto-reply/reply/reply-run-registry.ts src/auto-reply/reply/reply-run-registry.test.ts; git diff --check origin/main...HEAD; OPENCLAW_LOCAL_CHECK_MODE=throttled pnpm check:changed --timed
  • Changelog: updated
  • Land commit: d929e2a
  • Merge commit: 8fe196e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram lane stays queued after completed run/tool failure; bot sends no-op replies after compaction

1 participant