Repository navigation
Conversation
Owner
Author
|
Merged upstream as RizRiyz#506 (squash commit 0062178). Closing this mirror. |
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.
Summary
A scheduled automation worker pane now restores as a plain shell. Its headless agent run is no longer reopened as an interactive session after a server restart, in that lifetime or any later one. Interactive panes, manual ORCH workers, and
active_agentautomations resume as before.Follow-up to RizRiyz#488/RizRiyz#490. RizRiyz#488 promised to check how the optional Luvus Devin hook behaves in a scheduled run. That check, run on the merged Devin automation profile, found that the next server restart reopened the worker's session. The cause turned out to be agent-agnostic, so this PR fixes it for every agent instead of special-casing Devin.
Closes RizRiyz#497
What
src/app/board.rs:task_startmarks the pane inApp::automation_worker_paneswhen it launchesTaskAgentLaunch::Automation. Manual task starts andactive_agenttargets are never marked.src/app/mod.rs: a pane leaves the set when it closes, at the same point asbackend_non_restorable. Restore reads the mark back and ignores anyagent_sessiona marked pane still carries, for example from a hand-edited snapshot.src/persist.rs:PaneSnap::automation_worker(#[serde(default, skip_serializing_if = "Not::not")]), so ordinary panes keep the existingsession.jsonshape and older snapshots still load.(agent, cwd)discovery group, so an interactive pane beside it remains ambiguous, as today.resolve_pane_sessionsnever binds a worker, whether by title or as "one pane, one session".pane.report_sessionbinding is unchanged, so Mission Control and usage still see the run. It is only kept out of resume.website/public/agent-readme.md. Neither skill copy describes restore, so both are unchanged.Design choices
RizRiyz#497 raised two open questions, each with two options. This PR deliberately takes the first option in both. Either one can be switched if you prefer the other.
backend_non_restorablepath drops a pane from its discovery group, and that would let an interactive pane in workspace mode inherit the worker's conversation.Why
Neither
api_pane_report_sessionnorcapture_session_evidenceknew that a pane was an automation worker. A worker pane could be bound in either snapshot pass: by a hook report, as measured with Devin and Claude, or by native discovery when its run was the only session in its directory, as measured with Codex. The next restart then ran<agent> --resume <id>interactively, without the worker's access policy, and kept doing so on every restart after that.It shows up when the run finishes with no client attached, which is the usual case for a scheduled job, or when the server restarts during a run. With a TUI attached, process scans clear the binding when the agent exits. The full measurements are in RizRiyz#497.
The mark can't come from ORCH: pane ids are reallocated on restart, and
assigneeis either cleared or stale by then. A mark kept only in memory is not enough either. After one restart a restored worker screen can re-identify Codex, and the next restart would rebind it.Screenshots
The same scheduled Codex worker in both images: workspace mode, run with no client attached, then a server restart and a TUI attach. AGENTS is filtered to Active.
Before, on
main: the finished worker tab reopenedcodex resumeby itself and is waiting at Codex's trust prompt. AGENTS shows a liveblocked codexthat nobody started.With this PR: the worker tab restores as a shell with the finished run's output. AGENTS shows only the scheduled definition.
Verification
Windows 11, base
f6c68e9.cargo fmt --all --check(Rust 1.99.0, the current stable used by CI)cargo clippy --all-targets -- -D warnings(Rust 1.99.0, Windows)app::board:a_scheduled_worker_does_not_save_its_reported_session_for_resumea_scheduled_worker_is_not_bound_to_its_discovered_sessionan_interactive_pane_does_not_inherit_a_workers_sessionan_interactive_pane_keeps_its_own_session_beside_a_reported_workera_restored_scheduled_worker_stays_unbound_when_identified_againa_restored_worker_keeps_its_mark_across_restartsa_worker_snapshot_that_names_a_session_does_not_resume_itthe_worker_mark_is_saved_only_for_workers(including a snapshot without the field)a_worktree_scheduled_worker_is_marked_and_not_resumeda_failed_scheduled_start_leaves_no_worker_markclosing_a_scheduled_worker_forgets_ita_manual_task_worker_still_saves_its_reported_sessionpersist::title_resolution_tests:a_scheduled_worker_title_never_resolves_its_own_runapp::automation:active_agent_run_delivers_without_creating_an_orch_workernow also asserts that no pane is marked.an_interactive_pane_keeps_its_own_session_beside_a_reported_workercovers that.reported_session_*,agent_session_persists_and_resumes,app::automation::tests,persist::title_resolution_tests.cargo test --locked: on this Windows checkout the full suite stalls in five lock-heavy groups, as it does on unmodifiedmain. With those groups skipped (integration::tests,diff::notes::tests,config::tests,cli::tests::wait_status_stream,i18n::cli), this branch reports 2152 passed and 32 failed. The 32 failures are exactly the ones unmodifiedmainreports on this machine (CRLF docs tests,git::local, OSC 8, worktree, module titles,ipc::apistreams,uhp::gateway). A fewuhp::gatewayandapp::dispatch::tests::agentstests are flaky here under full-suite load on unmodifiedmaintoo, and they pass in isolation. CI covers the full suite on Ubuntu and macOS.fmt · clippy · test(Ubuntu, including the Unix-onlypersist::tests),macos test,windows protocol · ConPTY, bothnix flakejobs,cargo audit,npm audit, and the binary-size jobs passed.cargo build --release --lockednpm run buildinwebsite/LUVUS_HOMEand named sessions. The production server was not touched.read-only, worktree) with its session reported from the worker pane, plus an interactive pane with a reported session:agent_session: nulland"automation_worker": true; the interactive pane keeps its session and gets no new field;claude --resume '<id>';agent_session: null, and restored as a shell. Before this change, the same case saved the exec rollout and restored withcodex resume '<id>'.luvus integration install devin, which was the original report. The worker'sSessionStarthook bound its run (authority: prior_identity) as before. The snapshot saved it asnullwith the mark, and two restarts left a shell with nodevin --resume. The Devin config was restored byte for byte afterwards.Notes
session.jsonwritten before this change has no mark, so the first restart after upgrading still reopens an already-bound worker pane interactively. From then on that pane is an ordinary interactive agent pane and keeps resuming, as it does today, until it is closed. Workers started after the upgrade are marked.<agent> --resume <id>).persist::testsrun in CI.