Repository navigation
Conversation
Greptile SummaryThis PR fixes a correctness bug where steer/interrupt messages were blocked during tool execution because the guard used The Confidence Score: 5/5Safe to merge — the fix is logically sound, well-tested, and the only remaining finding is a dead-parameter style concern. All P0/P1 issues are absent. The core lifecycle flag logic is correct for single-attempt runs (new flags are scoped per runEmbeddedAttempt invocation), the optional isStopped preserves backward compatibility, and 9 new tests cover the key states. The sole finding is a P2 dead-code concern on the isStreaming parameter. src/auto-reply/reply/agent-runner.ts — the isStreaming parameter is now unused; worth annotating or removing in a follow-up.
|
8ea54db to
8cb2669
Compare
8cb2669 to
adb0f58
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adb0f588b3
ℹ️ 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".
adb0f58 to
a9a1806
Compare
|
Ready for review — requesting @tyler6204 and @joshavant for a look when convenient. This is a small, independent fix (1 commit, 5 files) with clean CI on |
42285b0 to
3198898
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)
3198898 to
c7a7df5
Compare
…injection Replace the overly restrictive isStreaming() guard in queueEmbeddedPiMessage and queueReplyRunMessage with a precise agent-loop lifecycle check. The old guard blocked steer messages during tool execution (when isStreaming is false but the agent loop is still running), preventing legitimate steer/interrupt delivery. - Add isStopped() method to EmbeddedPiQueueHandle that returns true when the agent loop is not actively running (before first prompt or after prompt end). During these windows the steering queue is not drained, so messages would be silently dropped. - In attempt.ts, track agentLoopStarted (set immediately before activeSession.prompt()) and agentLoopStopped (set in the prompt finally block). isStopped = !started || stopped. - queueEmbeddedPiMessage and queueReplyRunMessage now check isStopped() instead of isStreaming(), correctly allowing steer during tool execution while rejecting during startup and teardown windows. - In agent-runner.ts, the steer guard uses isActive (run handle exists) instead of isStreaming, matching the broader acceptance window. - Add isStopped?() to ReplyBackendHandle interface. - Remove the now-dead isStreaming param from runReplyAgent and its destructuring in runPreparedReply. - 6 new/updated tests covering: not-streaming+running (tool exec), stopped (teardown), not-yet-started (startup), compacting, and streaming cases. Fixes openclaw#48003 Co-Authored-By: Cha <[email protected]> via OpenClaw
c7a7df5 to
9a3254d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a3254dddf
ℹ️ 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".
| if (handle.isStopped?.()) { | ||
| diag.debug(`queue message failed: sessionId=${sessionId} reason=agent_stopped`); | ||
| return false; |
There was a problem hiding this comment.
Restore streaming guard when stop state is unavailable
queueEmbeddedPiMessage now treats handles without isStopped as injectable, which affects existing embedded backends such as Codex app-server (extensions/codex/src/app-server/run-attempt.ts:216-229). Fresh evidence: that backend marks completed = true on turn/completed before it unregisters the handle (extensions/codex/src/app-server/run-attempt.ts:153-155 vs :275), creating a teardown window where this function returns true even though the run is already finished. In steer mode, runReplyAgent then exits early as if delivery succeeded, but turn/steer can reject against the completed turn and the message is silently lost instead of falling back to follow-up queueing.
Useful? React with 👍 / 👎.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate_or_superseded. Current main still has the old isStreaming-based gates, so this is not implemented on main yet; however, #73365 is an open maintainer replacement that explicitly carries forward this PR’s core fix, credits the contributors, addresses the Codex P1 compatibility finding, and removes the unrelated branch churn. Best possible solution: Close this PR in favor of #73365 as the canonical replacement, then review and land that narrower maintainer PR for the active non-streaming steer fix. Keep #65221 and #65222 as separate follow-up work for interrupt scheduling and Telegram delivery behavior. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex review notes: model gpt-5.5, reasoning high; reviewed against 16906780fd2c. |
Problem
The
isStreaming()guard inqueueEmbeddedPiMessageandqueueReplyRunMessageis too restrictive — it blocks steer/interrupt messages during tool execution (whenisStreamingis false but the agent loop is still running). This prevents legitimate message delivery in steer and interrupt queue modes.Upstream PRs #52351 and #60604 address related issues but neither has been merged.
Root Cause
isStreamingonly reflects whether the LLM is actively streaming tokens. During tool execution,isStreamingis false but the agent loop is still running and can drain steering messages between tool calls. The guard incorrectly rejects steer messages in this window.Fix
Replace
isStreaming()with a precise agent-loop lifecycle check viaisStopped():isStopped()returns true when the agent loop is NOT actively running — either before the first prompt starts (startup window) or after the prompt finishes (teardown window).agentLoopStartedflag set immediately beforeactiveSession.prompt()— after all pre-prompt work (image loading, hooks, overflow prechecks).agentLoopStoppedflag set in the promptfinallyblock.isStopped = !started || stopped— guards both startup and teardown windows while allowing steer during the full active agent loop (streaming + tool execution).In
agent-runner.ts, the steer guard changes fromshouldSteer && isStreamingtoshouldSteer && isActive. The now-deadisStreamingparam is removed fromrunReplyAgent, along with its unused destructure inrunPreparedReplythat was triggering an oxlint CI failure.Changes
runs.tsisStopped?toEmbeddedPiQueueHandle; addisStoppedguard inqueueEmbeddedPiMessageattempt.tsagentLoopStarted/agentLoopStoppedflags; exposeisStopped()on queue handleagent-runner.tsisStreamingtoisActive; remove deadisStreamingparamreply-run-registry.tsisStopped?()toReplyBackendHandle; useisStoppedinqueueReplyRunMessageget-reply-run.tsisStreamingdestructure (oxlint fix)runs.test.tsagent-runner.steer-guard.test.tsisStreaming:params from 4 existing testsTesting
runs.test.ts(14),agent-runner.steer-guard.test.ts(3),get-reply-run-queue.test.ts(3)isStreamingvariable)AI Disclosure
Fixes #48003
Related
Part of a 3-PR fix set for interrupt/steer message delivery:
isStreaming→isActive/isStopped)