Repository navigation
Conversation
The interactive worker waited 50 ms for a command and then served the session host (timers, MCP callbacks, `sendMessage` with `triggerTurn`); the RPC session thread waited 20 ms for a job. Both are idle spin rates on a front end that is doing nothing, and both were the only way state that does not travel through the worker's own channel was noticed. The wait is now a deadline with an explicit wake. A session registers one attention waker (`Handle::set_attention_waker`), called after the state the front end re-checks is already in place: - `CoreHost::post` wakes once the request is in the channel the front end serves; - `Handle::request_wrap_up` and `Handle::interrupt` wake once the flag is set. The interactive worker takes the wake as `SessionCmd::Wake` on its own command channel and serves the host at once (`WORKER_IDLE_TICK` 50 -> 250 ms as the deadline); the RPC session thread takes it as `Job::Wake` and re-checks its stop flags, its supervisory loop now waiting on a condvar (`RPC_IDLE_TICK` 20 -> 250 ms). One wake in flight per front end is enough: the waker coalesces on a pending flag that the front end clears when it serves, so a wake raised while one is served is not lost. A panic in the waker is contained, like other front-end callbacks. Idle wakeups fall from 20/s to 4/s per thread; nothing waits longer than the tick for one of these events, and no command, inbox follow-up, cancellation or shutdown path needs the tick at all. Refs #877.
The boot preload (O-152) was triggered by the worker's first idle tick. With the tick at 50 ms that also made it run before a user's first prompt in practice; at 250 ms the worker is still waiting when the first prompt arrives, so the preload never ran for that session (the wire is no longer empty after the first turn) and `keys_settings::set_011` failed in CI. The preload is not an idle wait: it is now attempted on the first pass in which the worker would otherwise wait, for the session it started with and for every session a reopen gives it. `idle_tick` still tries it, so a session whose hook set had requests pending at that instant is retried on a tick, as before. Refs #877.
A prompt typed after Ctrl+C was sent as steering on a run that had already ended, so the core dropped it and the next answer never came. The activity state, not the session's claim, decides whether a run is active: the claim is held past the end of the run for the settle work (hooks, the status file). - A dropped reply (aborted, failed, cut) clears the activity at once; a run that continues sets it again on its next turn. - After the user aborts, input is a new prompt until the run reports a new turn: an aborted run ends without delivering steering, so steering there would be lost. Fixes the i699_interrupt PTY checks for both the generation and the tool abort paths.
|
Follow-up commits by oxa in the goal loop, model
🤖 Generated with Claude Code (oxa goal loop) |
The boot preload (O-152) is sent as soon as a session is ready, before the worker's first wait, so the first request the fake sees in `generation_pty_ctrl_c_cancels_and_keeps_prompt_usable` is the `max_tokens: 0` preload. The check waited for "any request", then sent the Ctrl+C at the preload: it cancelled the background request and not the run it means to cancel. Wait for the request of the foreground turn itself (`max_tokens > 0`), which is the activity the interrupt must land on. Refs #877.
An aborted run returns from the agent loop before `deliver_steering`, so a message queued in the moment between the aborted tool result and `AgentSettled` was never delivered and never handed back: the run ended with the message stuck in the steering queue. `oxa-cli::i699_interrupt tool_pty_ctrl_c_stops_tool_without_exiting` timed out waiting for the reply to the message typed after `Command aborted`. `Handle::is_aborting()` reports the run that holds the session while it winds down (claimed with `cancel` set: a front-end abort or the run's own loop guard), so a message queued there would never be taken. Enter/Alt+Enter now queue text only when a run is active, still takes a tool batch and the user has not aborted it ([`Loop::accepts_steering`]); otherwise the text starts a new run. Ctrl+C is unchanged. Tests: oxa-interactive d1 `enter_while_the_run_is_aborting_starts_a_new_run` (fails before the fix with `["x"]` stuck in the steering queue) and the oxa-core queue unit test for the new accessor. Refs #699, #906.
|
CORRECTION: the shared O411 packet was invalid due to an upload collision. My disposition and requested action here are retracted; retain the actual primary owner and sole writer. No PR closure or branch deletion occurred. On710 only, I already marked ready and pushed normal main merge8c3bd4a9 (own112-line test diff unchanged), lane44078156424 with one120s watcher; these facts are handed to coordinator for the actual owner. No further writes from this lane to the wrong packet PRs. |
|
Follow-up commits by oxa in the goal loop, model 🤖 Generated with Claude Code (oxa goal loop) |
|
O411 primary disposition FLAG on actual currentefd0957 (packet'sb7cf424 is stale); retain existing helper877. Source changes worker/RPC idle deadlines to250ms and installs attention wakers unconditionally, without the #939 module default-off control for this new non-release behavior. Keep the introduced #906 abort-window input repair and its real controls; do not drop useful work or force a size split under O417. Current writer owns any flag/extraction and CI; no local build/test, duplicate writer, numerical timeout relaxation or full repeat review from this lane. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efd09578ac
ℹ️ 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".
| fn running(&self) -> bool { | ||
| self.vm.status.activity != Activity::Idle |
There was a problem hiding this comment.
Preserve in-flight state until AgentStart is consumed
When the worker begins a prompt after drive has drained worker messages but while term.poll is waiting, the handle is busy but the UI has not yet consumed AgentStart, so this now reports idle. Input received during that poll is consequently sent as another SessionCmd::Prompt rather than steering, and Ctrl+C follows the idle clear/exit path instead of aborting the active run. Preserve an in-flight signal for this interval without reintroducing the post-reply settling problem that motivated removing the unconditional is_busy() fallback.
Useful? React with 👍 / 👎.
| if preload_due { | ||
| preload_due = false; | ||
| if let Some(s) = session.as_mut() { | ||
| idle_tick(s, &out, &mut ui_proxy, &mut last, &stop); | ||
| run_boot_preload(s, &out, &mut ui_proxy, &stop); |
There was a problem hiding this comment.
Arm preload cancellation before the final queue check
If user input arrives after the top-of-loop try_recv finds the command channel empty but before run_boot_preload sets preloading, Loop::send observes is_preloading() == false and therefore does not cancel the background work. The worker then starts the potentially slow engine prefill and leaves the already-queued prompt waiting for it to finish, contrary to the documented behavior that user input cancels the preload so the command starts immediately. This race is especially reachable just after the worker announces a new or reopened session.
Useful? React with 👍 / 👎.
| fn install_wake(handle: &Handle, wake: &Sender<SessionCmd>, pending: &Arc<AtomicBool>) { | ||
| let tx = wake.clone(); | ||
| let pending = pending.clone(); | ||
| handle.set_attention_waker(Arc::new(move || { | ||
| if !pending.swap(true, Ordering::SeqCst) { | ||
| let _ = tx.send(SessionCmd::Wake); |
There was a problem hiding this comment.
Let command-channel disconnection terminate the worker
Because the worker installs a waker that owns a clone of the sender paired with cmds, dropping every external command sender can no longer disconnect the receiver. In that documented shutdown scenario, recv_timeout returns only Timeout, the Disconnected branch is unreachable, and the worker keeps ticking indefinitely unless someone explicitly sent Shutdown first. Use a wake mechanism that does not keep the command channel alive, or explicitly release the internal sender when external ownership ends.
Useful? React with 👍 / 👎.
| fn accepts_steering(&self) -> bool { | ||
| self.running() && !self.abort_requested && !self.handle.is_aborting() |
There was a problem hiding this comment.
Mark Escape-triggered aborts as pending
The new abort_requested guard is set for Ctrl+C but not for the app.interrupt/Escape path, even though that path also calls Handle::abort. Once the core releases its busy claim, is_aborting() becomes false; if the UI has not yet consumed the queued dropped-reply or settled event, its activity is still non-idle and input is admitted as steering into the run that just ended. Set the same pending-abort state when Escape aborts a run so text entered in this window becomes a new prompt instead of remaining stranded in the steering queue.
Useful? React with 👍 / 👎.
|
First-pass review by oxa → oxc →
🤖 Generated with Claude Code (oxa review lane) |
|
First-pass review by oxa → oxc → Codex findings
🤖 Generated with Claude Code (oxa review lane) |
|
@codex review |
|
First-pass review by oxa → oxc → Codex findings
No additional concrete defects substantiated. 🤖 Generated with Claude Code (oxa review lane) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4177d9abe4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fn running(&self) -> bool { | ||
| self.vm.status.activity != Activity::Idle | ||
| || (self.handle.is_busy() && !self.worker.is_preloading() && !self.worker.is_drafting()) | ||
| || (self.handle.is_running() && !self.worker.is_preloading() && !self.worker.is_drafting()) |
There was a problem hiding this comment.
Preserve active-run detection for user bash commands
While a long-running !cmd or !!cmd executes, user_bash claims shared.busy directly but never sets gate.running, and its BashExecutionUpdate events do not change the UI activity from Idle. Replacing the busy check here therefore makes these commands appear idle throughout execution. Ctrl+C now takes the editor-clear/exit path instead of cancelling the command, and Escape likewise skips Handle::abort. Include foreground bash execution in the new running signal while continuing to exclude background preloads and post-reply settlement.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4177d9abe4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if matches!(&entry.body, EntryBody::Shown { why, .. } if [shown_why::ABORTED, shown_why::FAILED, shown_why::CUT].contains(why)) | ||
| { | ||
| st.shared | ||
| .gate | ||
| .running | ||
| .store(false, std::sync::atomic::Ordering::SeqCst); |
There was a problem hiding this comment.
Preserve the running signal across recoverable reply cuts
When a stream breaks after producing output and automatic replay is enabled, run_inner persists Shown { why: CUT } and continues the same run with another request. This clears gate.running, but neither the replay branch nor subsequent turns restore it; only a new run_loop invocation does. If the UI consumes the cut entry and enters term.poll before consuming the replay's MessageStart, both its activity and the shared signal report idle even while the replay executes. Enter consequently submits a separate prompt instead of steering, and Ctrl+C clears the editor instead of cancelling the request. Keep the foreground signal active for recoverable cuts, or restore it before continuing the request.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
st coordinator>codex-lead #902 owner=codex-lead track=later lane-time=deferred note="Named owner for later board pickup; current lane time goes to the native P0 finish list." |
Stage 1 · Lead → Local revival reviewThe original #902 is open and DIRTY at Current conflict preview. Read-only merge-tree against exact main
Six open review threads. Source at the preserved head contains repairs for unconsumed AgentStart, preload admission, TUI channel disconnect and Escape settlement. Keep them open until exercised on the composed head. The other two are still substantiated:
Fit to ordinary Sessions and typed waits. Key wake ownership to the existing full Use #1327's existing Qualification order for Local. First compose the wake primitives and input/lifetime controls with the current Session and a2a paths. Exercise wake-before-wait, wake-during-service, rebind/stale wake, EOF/drop with a blocked reader, shutdown with work pending, and both remaining foreground gaps using existing mocked/PTY harnesses. Then qualify typed parking, duplicate/stale wake and deadline-only zero-model behavior, fresh exact clearance once, and reopen/rearm without losing the original receipt. Parent-tree shutdown/checkpoint/join, crash fencing and dependency-ordered resume are separate #1199 acceptance. Report the real wait path and model-call count. The old 250 ms fallback ticks remain polling, and old wake latency tests are regression guards, not proof of zero polling or CPU savings. Reconcile the earlier default-off finding with the current owner direction before changing default TUI/RPC behavior. Earlier flag finding The old exact-head selected lane and required PR checks succeeded. They do not qualify the current integration. This is a review handoff to Local; no branch, source, review gates, sessions, CI or model were changed. |
T2 — refs #877 and #906. Wake interactive/RPC front ends when real attention arrives, keeping the idle deadline as fallback. Preserve fresh input across cancellation, worker shutdown and event-delivery races.
Current repair head: 4177d9a. A normal main merge resolved actual conflicts in app.rs, driver.rs and i699_interrupt.rs, retaining main's PTY diagnostics, local-memory status sample and recovery-prompt boundary.
Address the four canonical findings:
Removes: strong worker/callback ownership of their command channel, activity-only classification of an unconsumed foreground start, and unarmed preload admission after an empty queue check. These caused lifetime and input races. No feature, test, sandbox check, scanner, timeout, cap or negative guard is removed. Shutdown precedence, coalesced wakes and bound recovery handles remain.
Evidence: regression-only b08c8ff/run44144213820 fails the disconnected-front-end test; it also has PTY/key_010 failures, not dismissed as flakes. Run44144480353 caught a missed signature update, corrected at62cf43c. Run44145775500 at62cf43c reaches tests but remains red on tool PTY/key_010. New regression-only fec4cf8 covers unconsumed AgentStart and post-release Escape before current fixes. Current4177d9a adds a held, non-cancellation failed-reply control to guard against stale busy-settlement behavior. Exact hosted before/after results are pending; no green or landing qualification claimed.
Local validation: formatting, git diff --check and a niced single-crate cargo check -p oxa-interactive --all-targets pass. Full builds/tests remain hosted CI. No engine, provider/auth, accounting, credential, wire, manifest or workflow changes. Existing PR only; no force push, author merge or manual review request.
Resource effect: one boolean in the existing instance gate and one front-end Arc per worker; attention callbacks borrow weakly. No additional queue or polling deadline. Idle CPU/context-switch savings remain unmeasured. The earlier default-off module disposition remains an explicit policy gap; current-head CI, automatic Cloud review and normal owner gates remain required.