Skip to content

oxa: wait with a deadline and wake on real attention instead of polling - #902

Open
n0rpan wants to merge 13 commits into
mainfrom
oxa/issue-877
Open

n0rpan wants to merge 13 commits into
mainfrom
oxa/issue-877

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • Front-end command senders own the strong Arc; worker and attention callback use Weak references, so dropping external senders disconnects the receiver.
  • A foreground signal in the existing instance gate bridges the interval before AgentStart is consumed. It clears when a failed/aborted/cut reply is persisted and on guard drop, so the busy settlement claim cannot reactivate a dropped turn.
  • Arm preload cancellation before checking the existing command backlog after the background claim. Queued commands defer preload, remain in the same backlog, and run without waiting an idle tick. Recheck background cancellation after command publication to close the token-reset/send window; foreground cancellation stays separate.
  • Escape retains the same explicit recovery boundary as Ctrl+C, including when the core claim has already released while UI activity remains stale.

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.

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.
@n0rpan n0rpan added this to the v0.2.2 milestone Nov 17, 2026
@n0rpan n0rpan added the after-0.2.1 Approved work held until v0.2.1 is branched; merges in one batch after label Nov 17, 2026
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.
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up commits by oxa in the goal loop, model openrouter/deepseek-v4.1-flash; outside checks: checks STILL RED: see body; new head fd662ea7.

🤖 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.
@oxa-agent oxa-agent Bot mentioned this pull request Nov 17, 2026
@oxa-agent

oxa-agent Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

st codex-n0rpan #902b7cf424 disposition=SPLIT writer=existing-helper own-lines=477 next=split-existing+default-off note="After-v021 wake optimization needs explicit opt-in;retain host/cancel/wrap-up controls and existing source."

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up commits by oxa in the goal loop, model openrouter/deepseek-v4.1-flash; outside checks: checks STILL RED: see body; new head efd09578.

🤖 Generated with Claude Code (oxa goal loop)

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

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.

@oxa-orchestrator
oxa-orchestrator Bot marked this pull request as ready for review November 17, 2026 14:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T19:04:09.117105Z 614a0cc Manual request
🔒 Security Review ✅ Completed 2026-11-17T14:17:46.545896Z efd0957 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 700 to 701
fn running(&self) -> bool {
self.vm.status.activity != Activity::Idle

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread oxa/oxa-interactive/src/app.rs Outdated
Comment on lines +573 to +576
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread oxa/oxa-interactive/src/app.rs Outdated
Comment on lines +370 to +375
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +711 to +712
fn accepts_steering(&self) -> bool {
self.running() && !self.abort_requested && !self.handle.is_aborting()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head efd0957 (O-241; the orchestrator adjudicates and enqueues).

  • P2 — oxa/oxa-interactive/src/app.rs:515: The worker now owns a sender to its own command channel, both through wake and the registered attention closure. If the front end drops its command senders without sending Shutdown, recv_timeout can never return Disconnected; the worker remains alive, ticking and retaining the session indefinitely. Previously channel disconnection terminated it.
  • P3 — oxa/oxa-interactive/tests/d1_main_loop_and_regular_mode.rs:601: The abort regression test supplies no worker events, leaving activity Idle. With the new activity-only running(), it sends a fresh prompt even if the entire accepts_steering() abort protection is removed. Thus it does not exercise the advertised failure window: an aborted handle while the UI still shows an active run. Supply an AgentStart event before submitting input so removing that protection fails the test.
    TIER: T2
    VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head 62cf43c (O-241; the orchestrator adjudicates and enqueues).

Codex findings

  • CONFIRMED — P2, oxa/oxa-interactive/src/driver.rs:699: running() uses only UI activity. If a run starts while terminal polling waits, before AgentStart is consumed, input is dispatched as another prompt and Ctrl+C takes the idle path instead of aborting.
  • CONFIRMED — P2, oxa/oxa-interactive/src/app.rs:585–590: Preloading is armed only inside run_boot_preload, after the command-channel check. Input queued between those operations sees no preload to cancel and must wait for the background prefill.
  • FIXED — oxa/oxa-interactive/src/app.rs:369–381: The attention waker now holds a weak sender reference, so it does not prevent command-channel disconnection; a regression test covers dropping the front-end sender.
  • CONFIRMED — P2, oxa/oxa-interactive/src/driver.rs:1440–1441: Escape aborts without setting abort_requested. After the busy claim is released but before terminal events are consumed, is_aborting() is false while UI activity remains active, so newly entered text can become stranded steering.
    TIER: T2
    VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head 4177d9a (O-241; the orchestrator adjudicates and enqueues).

Codex findings

  • FIXED — In-flight state: begin_run() sets the shared foreground flag before AgentStart; the driver uses it without treating dropped-reply settlement as active.
  • FIXED — Preload cancellation: cancellation is armed before the final command-queue check, and input cancels background work again after publication.
  • FIXED — Command-channel disconnection: the worker’s waker now holds a weak sender reference, allowing external sender drops to disconnect the receiver.
  • FIXED — Escape abort: the interrupt path now sets abort_requested before aborting, keeping subsequent input out of the stale steering queue.

No additional concrete defects substantiated.
TIER: T2
VERDICT: CLEAR

🤖 Generated with Claude Code (oxa review lane)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +820 to +825
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 614a0cc1ec

ℹ️ 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".

@oxa-orchestrator

Copy link
Copy Markdown

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."

@oxa-agent

oxa-agent Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Stage 1 · Lead → Local revival review

The original #902 is open and DIRTY at 614a0cc1ece6cfa323e8574a40bd82cadd499678. Its existing source and red controls are preserved. The owner’s accepted design uses ordinary long-lived oxa Sessions and typed Board waits. The wake is a notification to recheck state. It has no authority to clear a wait, interpret external text as instructions, or launch work. Owner design · Tree lifecycle acceptance

Current conflict preview. Read-only merge-tree against exact main 6f0fa308eb469fbadbeea6757200c12548260ecf found text conflicts only in oxa-core/src/agent_loop.rs (Goal steering scope vs foreground-start flag) and oxa-rpc/src/server.rs (typed GoalControl vs Wake job, loop arguments, receive dispatch and worker startup). Keep main’s saved-steer delivery, revision/lease authorization, control_pending/receipt sequencing and full SessionRef watcher rebind. Reuse the attention mechanism around them. The TUI/app, queue and Session files merge textually, and their semantic checks below still apply. Main agent loop · Main RPC receive path

Preserved hunk What to reuse
145eb7ef, core queue.rs:137–163,480–490 and host.rs The one existing Handle attention callback and publish-state-before-notify ordering. Keep callbacks cheap. Re-read the underlying condition after a wake. The callback is transient and owns neither a Session nor a Claims row. Wake source
0c9d146e + 62cf43c3, TUI app.rs:371–380,571–624; b08c8ffa control Weak sender, one coalesced wake, clear pending before service, shutdown precedence, and exit when all external senders drop. Keep session-switch/rebind tests so a stale callback cannot consume the current session's wake. Ownership repair · Disconnect control
88285d26 + 4177d9ab, app.rs:770–790 and driver.rs:719–737 Arm background cancellation before the final command-channel check. Retain queued commands in the existing backlog and recheck cancellation after publish. Foreground input and background cancellation remain separate. Preload/input source
fd662ea7, efd09578, fec4cf8c, 4177d9ab, 614a0cc1 Reuse foreground-start and dropped-reply settlement distinction, shared Escape/Ctrl-C pending-abort boundary, and the real unconsumed-start, settled-Escape and held failed-reply controls. Keep main’s PTY and recovery-prompt behavior. Red input controls · Preserved head
145eb7ef, RPC server.rs:481–522,703–794 Reuse coalesced job wake plus completion condition variable, explicit EOF/router shutdown, and the wrap-up-before-tick fixture. The archived RPC callback and session loop retain strong channel senders, so preserve explicit Shutdown on EOF and input-thread failure, preserve join, and keep an owner-drop termination path. The detached stdin reader was scoped to a process about to exit. A long-lived parent cannot use it as an orphan-handling contract. RPC source

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:

  • Foreground bash takes shared.busy in user_bash.rs:45 without setting gate.running. Its update events do not start the foreground UI activity. Preserve Escape/Ctrl-C cancellation for both !cmd and !!cmd, and demonstrate fresh input after abort. Treat bash as cancellable foreground activity without routing its input into an undrained model steering queue.
  • Recoverable reply cut persists Shown(CUT) in the replay branch at agent_loop.rs:259–286. persist at 820–825 clears the foreground flag, and that branch continues before a new run starts. Keep foreground input/cancel live through the replay boundary and keep terminal-cut/failed-reply settlement closed to steering. Verify Enter and Ctrl-C while the cut entry is consumed and the replay start event is still unconsumed.

Fit to ordinary Sessions and typed waits. Key wake ownership to the existing full SessionRef {path,id} and active owner. Re-read bound Goal and Claims state on wake or reopen. Keep send_inbox_control and the durable Session::stage_lead_steer admission/receipt boundary with Local #1446. Preserve accounting-only revision tolerance and stale refusal on objective, reassignment or terminal control changes. A wake neither acknowledges a steer nor increments progress.

Use #1327's existing DependencyWait row and #1341's resume_dependency_for and ActivityTiming::next_wake. At current main the native caller already skips authenticated parked claims, while these parking/resume APIs and the deadline helper lack production callers in the inspected tree. Observe authoritative CI/head/item/owner-read and quiescence evidence before a transition. Under the Claims lock, compare the exact wait, revision, current host/renewable receipt, original binding and worker-idle/import fences. The verifier must not re-enter Claims or acquire task/repository locks. An elapsed deadline schedules a bounded reassessment, with no auto-clear, task start, release, or model call. Keep existing all-parked, elapsed-deadline and parked-next CLI controls. Park/resume authority · Deadline rule · Native controls

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.

This branch has not been deployed

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

Labels

after-0.2.1 Approved work held until v0.2.1 is branched; merges in one batch after

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant