Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0aeeac6934
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR fixes the interrupt-mode race where a new user message was dropped with "
Confidence Score: 4/5Safe to merge; the fix substantially narrows the race window and the remaining gap requires an extremely unlikely timeout scenario. All P2 findings. The identified gap in get-reply-run-queue.ts (force-detach returns false when only a stale ReplyOperation remains) is a real correctness hole but extremely unlikely in practice given the 15-second timeout budget. Core logic changes in reply-run-registry.ts are well-reasoned and well-tested. Score of 4 rather than 5 to flag the gap for author awareness. src/auto-reply/reply/get-reply-run-queue.ts lines 48–76 (force-detach fallback gap when embedded run already ended); src/auto-reply/reply/get-reply-run-queue.test.ts (three tests outside describe block).
|
0aeeac6 to
e8c7333
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8c73338f5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
e8c7333 to
3f12b2f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f12b2f94f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
289a202 to
b9296a9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9296a93eb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
b9296a9 to
ec6f843
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec6f843ba2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ec6f843 to
d754b46
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d754b46c1f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
d754b46 to
b8d1141
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8d1141544
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
b8d1141 to
fee13b8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fee13b89b6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
a7b076f to
64a0c1c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64a0c1c209
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
64a0c1c to
875a8d5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 875a8d5adb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
875a8d5 to
701e034
Compare
(cherry picked from commit fcc86f0)
(cherry picked from commit f350bb4)
…dit (openclaw#69581) * fix(codex): exclude codex-app-server synthetic apiKey from secrets audit The Codex extension uses the literal string "codex-app-server" as a hardcoded placeholder apiKey in provider.ts, since the real authentication is managed by the app-server transport itself. The secrets audit currently reports this as a real plaintext leak (PLAINTEXT_FOUND), producing a false positive for any user who has configured the Codex harness. Declare it as a plugin-owned non-secret marker in the Codex plugin manifest, so it flows through the standard `listKnownNonSecretApiKeyMarkers()` path alongside `ollama-local`, `lmstudio-local`, `gcp-vertex-credentials`, and `minimax-oauth`. Also extends the existing `model auth markers` unit tests to lock in the behavior. Fixes openclaw#69511 * ci: retrigger checks (no-op) (cherry picked from commit 081da17)
openclaw#69338) When ingestDelta returns null (first empty/commentary delta or unchanged content), the handler returned early, skipping setActivityStatus and armStreamingWatchdog. If all subsequent deltas were also null (e.g. due to phase filtering), the watchdog was never armed and the status bar stayed stale as "idle" while a run was live. Move setActivityStatus("streaming") and armStreamingWatchdog before the null-displayText guard so they fire on every received delta event. Fixes openclaw#34513, openclaw#40824 Co-authored-by: Claude Sonnet 4.6 <[email protected]> (cherry picked from commit 89b6d02)
701e034 to
eb0d04b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb0d04b3ce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // identity gate additionally covers the "newer op still | ||
| // running at retry" edge where seq advanced but the | ||
| // registered object is not our stale one. | ||
| force: waitInterrupted && staleReplyOperation ? { ifStale: staleReplyOperation } : false, |
There was a problem hiding this comment.
Tie forced retry to the timed-out operation
force is derived from waitInterrupted plus the operation currently in the registry, but waitInterrupted only tells us that an earlier wait timed out, not that the currently active operation is that same stale run. In interrupt bursts, request A can time out on old run O, then collide with newer run B and set force: { ifStale: B }, which lets A abort B on retry and run out of order (dropping newer user input). Fresh evidence in this commit is that the retry force token is built from replyRunRegistry.get(...) at catch time rather than from the specific run that timed out.
Useful? React with 👍 / 👎.
…Operation registries
- Rename forceDetached → waitInterrupted for clarity: the flag indicates
whether the waitForActiveRunEnd was forcefully interrupted, not whether
a detach operation succeeded.
- Two-phase abort: interrupt → waitForEmbeddedPiRunEnd → refreshPreparedState
→ check isActive; if still active, attempt forceDetachActiveRun.
- forceDetachActiveRun return value is advisory — scheduling layer commits
to superseding regardless; createReplyOperation handles residual
ReplyOperation state.
- Stale waiter cleanup: forceDetachActiveRun resolves waiters with false
immediately to prevent leakage.
- Identity-gated force-supersede: createReplyOperation's force now accepts
`{ ifStale: ReplyOperation }`. At the interrupt-retry site in
agent-runner, the stale ReplyOperation is captured synchronously in the
ReplyRunAlreadyActiveError catch, then the retry passes the ref so the
force only fires when the registered op is object-identical to the
original stale one. If a newer request registered during the 500ms wait
window, the retry throws and we return "try again" instead of
preempting the legitimate newer run.
- Creation sequence counter: reply-run-registry tracks a monotonic per-
sessionKey createSeq incremented on every successful createReplyOperation.
The interrupt-retry path captures staleSeq alongside staleReplyOperation
and rejects the retry when seq advanced during its wait. Closes the
window where a newer request supersedes the stale run AND completes
before the older retry wakes — identity-gate alone can't detect that
case because the registry is empty again by retry time.
eb0d04b to
ae72379
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae72379c7b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // (nothing in the registry to compare against). The seq | ||
| // check rejects the retry and returns "try again" instead of | ||
| // running our older input out of order. | ||
| const staleReplyOperation = replyRunRegistry.get(replySessionKey ?? ""); |
There was a problem hiding this comment.
Tie forced retry to the timed-out operation identity
The retry force token is taken from replyRunRegistry.get(...) after the first ReplyRunAlreadyActiveError, so in interrupt mode a request that timed out on an older run can end up force-superseding a newer run that already took over. In a burst (waitInterrupted === true), if request A times out on stale run O and request B registers before A reaches this catch block, staleReplyOperation becomes B and the retry uses force: { ifStale: B }, allowing A to abort B and run out of order (dropping newer input).
Useful? React with 👍 / 👎.
|
Thanks for the fix attempt. Closing this because the branch is dirty/XL and spans generated docs, Discord, gateway, qa-lab, scripts, and agents; please resubmit the interrupt scheduling race fix as a clean narrow PR with the repro/validation. |
Problem
When a user message arrives during an active run in interrupt queue mode, the scheduling layer rejects it with "⚠️ Previous run is still shutting down" and the message is lost.
Root cause
Two registries track run activity:
ACTIVE_EMBEDDED_RUNS(scheduling) andReplyOperation(delivery). After abort:waitForEmbeddedPiRunEndresolves whenACTIVE_EMBEDDED_RUNS.delete()firesisEmbeddedPiRunActive()checks both registries via ORReplyOperation.clearState()runs in the old runsfinallyblock — not yet completeresolveBusyState()→isActivestill true → rejectedChanges
1. Two-phase wait (
waitForEmbeddedPiRunEnd)After the embedded run handle is removed, chain
waitForReplyRunEndBySessionIdwith remaining timeout budget so callers see a fully idle session.2. Force-detach fallback (
forceDetachEmbeddedRun)When abort+wait times out, remove the old runs handle from
ACTIVE_EMBEDDED_RUNSso a new run can register immediately. The old runs finally block detects handle mismatch → no-op.3. Retry with force (
agent-runner.ts)On
ReplyRunAlreadyActiveError, wait 500ms for the reply-op to clear, then retry withforce: true. Only in interrupt mode — collect/followup modes preserve the existing run to avoid dropped assistant progress.4. Reply-run-registry hardening
skipNotifyoption prevents premature waiter resolution during force-supersedeisReplacedbranch returns immediately without mutating maps the replacement op may referencewaitKeysBySessionIdaliases to remove stale entries after session rotationKnown Limitations
sessions_sendHTTP connections cannot be cancelled after abort.Tests
29 tests passing across 3 test files:
runs.test.ts: force-detach,isEmbeddedPiRunActiveForSessionKey, handle identity guardget-reply-run-queue.test.ts: force-detach + direct return, force-detach failure fallbackreply-run-registry.test.ts:skipNotify,isReplacedbranch, alias preservation during force-supersedeRelated
Part of a 3-PR fix set for interrupt/steer message delivery:
isStreaming→isActive)AI Disclosure