Repository navigation
Conversation
Keep message completion separate from run state by sharing the message lifecycle controller lookup between arrival and completion. Consume the completed input without retiring a still-running tool owner. Cover the diagnostic heartbeat, queue accounting, and existing Send now affordance; retain timeout and UI presentation policy.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
November 8, 2026 01:15
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
deleted the
steipete/perf-micro-long-running-session-idle-with-active-tool-20260919
branch
November 8, 2026 01:26
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 8, 2026
Keep message completion separate from run state by sharing the message lifecycle controller lookup between arrival and completion. Consume the completed input without retiring a still-running tool owner. Cover the diagnostic heartbeat, queue accounting, and existing Send now affordance; retain timeout and UI presentation policy.
roboclaw-bot
added a commit
that referenced
this pull request
Nov 8, 2026
Preserve the processing and queue-consumption contract introduced by #194907. Assert controller retirement ordering and inject finalization failure at message completion while retaining rejection and admission-release checks. Co-authored-by: steipete <[email protected]>
steipete
added a commit
that referenced
this pull request
Nov 8, 2026
Preserve the processing and queue-consumption contract introduced by #194907. Assert controller retirement ordering and inject finalization failure at message completion while retaining rejection and admission-release checks. Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: steipete <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 9, 2026
…#195026) Preserve the processing and queue-consumption contract introduced by openclaw#194907. Assert controller retirement ordering and inject finalization failure at message completion while retaining rejection and admission-release checks. Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: steipete <[email protected]>
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.
What Problem This Solves
Fixes diagnostics reporting an idle session while its run is still executing a tool, after a steering message finishes dispatching or falls back to the follow-up queue.
User Impact
Long-running-session logs and diagnostic events retain
processingwithactiveWorkKind=tool_callduring active execution. Queue accounting still consumes the completed dispatch without counting the active original input as backlog. No configuration or migration is required.Why This Change Was Made
Message completion was unconditionally publishing session idle. The message-lifecycle producer now shares its existing controller lookup between arrival and completion, while the diagnostic writer can consume the completed input independently of the published state. Controller retirement remains authoritative. Production code grows by two lines to separate message accounting from run state, with no new cache or scan.
The Control UI uses a separate run projection and pending-input capability, so no UI production change is needed. A mocked-Gateway regression verifies a 215-second active exec with a 30-second pending steer shows Stop and Send now, and targets the exact input. The existing 120-second transcript-commit timeout can withdraw a steer and remove its Send now capability after follow-up fallback; this PR does not change that policy.
Related: #193665. Complements #194805 without changing its files or presentation.
Evidence
The heartbeat regression fails on base
ec41ea83a44cf84f2cdc1cf4a7d7b0983523952cwithstate=idle activeTool=exec reason=tool_execution_wait, then passes with correct processing state and backlog. Focused core tests: 46 passed (new regression 21 ms). UI E2E: 12 passed (18.294 s test time); the final fixture rerun passed in 996 ms. Component/access and Chromium sidebar tests: 40 passed (7.05 s). CI duration is pending.Codex autoreview of the complete local change against that base: P0–P2 scoped-clean, no actionable findings (fresh review after the gate-driven correction). The test-line allocation covers exactly 134 new lines for the distinct diagnostic-owner and browser contracts; the benchmark adds 185 proof-only lines.
check:changedcompleted red. It caught a patch-local import cycle and test lint pattern, both repaired; final targeted lint/types/format and cycle checks pass. Remaining main regressions: 20 historical attribution violations introduced by266a7aa0fe69(#194364), unusedOpenClawShellreported afteradca0b0844c7(#194815), and unusedCommandPaletteOpenDetailintroduced by9151ac22e005. All reproduce on the exact base; the two Knip reproductions reuse the existing same-base lane proof. No overall green or guard exception is claimed.The committed
scripts/perf/diagnostic-state-measure.tsuses 4,096 resident controller identities, 2,000 diagnostic entries, an outstanding exec and one queued input. Each measured steer constructs a fresh message lifecycle. Four A/A controls, five interleaved before/after pairs, separate allocation passes and CPU profiles cover two million dispatches. Every queue-count assertion passed; incorrect idle observations fell from every baseline sample to zero.This is a correctness cost, not a speedup: the additional indexed lookup and shared lifecycle helper add 417 ns median, approximately 0.38 microseconds CPU and 1.3 KB sampled allocation per steer. Median increases 50.06%, CPU 27.35%, allocation 47.82%; these exceed A/A variation and are retained as a small absolute per-message correctness cost. All five paired CPU changes were positive; A/A CPU ranged 139.161–146.594 ms per 100,000 actions. The benchmark excludes import/setup, diagnostic subscribers, database/workspace I/O, transport and real tool/provider execution. It makes no cold-start or full-Gateway performance claim. No live deployment was accessed.