Repository navigation
fix(app): agents see working sessions and archive warnings go back through the requester's channel (split of #4893, without session.stop) - #4903
Conversation
…hive one An agent archived its own running session from inside its turn: the app asked the person to confirm Stop and archive, but the bridge mailbox gave up after 5 s with a generic "window did not answer" error, and the dialog could not say who had asked. - session.list_sessions entries and session.read results carry `status` and `working` so agents can check before touching a session. - The Stop-and-archive dialog names the requesting agent session (title and id), or "this session itself" when a session asked to archive itself. - Bridged commands that open a human-only dialog answer at once with the structured code awaiting_user_confirmation and a hint naming target and requester; the dialog stays open for the person. Action-supplied codes and hints now reach the bridge unchanged. - The mailbox fallback message names the confirmation case. Signed-off-by: Guillaume Loret <[email protected]>
…gent
An agent that can start sessions could not stop one. session.stop
{ sessionId } is the Stop button for any loaded session: it aborts the
turn, cancels subtasks and queued messages, and never navigates. Idle
targets return alreadyIdle; unknown ids are a structured error. The
safeguard is attribution: the stop shows "Session stopped: <title>" with
the requesting agent session as a toast and as a notification-center entry
with a View action. Archive semantics are unchanged.
Signed-off-by: Guillaume Loret <[email protected]>
An agent's request must never open a dialog for the person. session.archive on a working session through the agent bridge now returns a structured refusal in the agent's own conversation: target_working (stop it first with session.stop if the user wants it closed, otherwise leave it running) or self_archive_while_working (finish the turn; the reviewer archives). Idle targets archive as before. The awaiting_user_confirmation race is gone. The person's own archive of a working session keeps its confirmation but simplified to the essentials: the session title, one question, Keep session open / Stop and archive. The Requested by row and forensic detail are withdrawn from the dialog; attribution stays on session.stop. Signed-off-by: Guillaume Loret <[email protected]>
… for MDX Signed-off-by: Guillaume Loret <[email protected]>
Split of #4893: this branch keeps everything Warden can self-clear — status and working in session.list_sessions / session.read, the agent path of session.archive that refuses a working target (target_working / self_archive_while_working) instead of opening a dialog, the simplified human confirmation, structured code/hint propagation through the bridge, the mailbox's 5 s message, and the docs. The session.stop control action (Warden 2AY-HF9: stop by id without confirmation, an explicit product decision that needs a human approver) is removed here and re-added in a stacked PR. The target_working hint now sends the agent back to the person instead of to session.stop. Signed-off-by: Guillaume Loret <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 1. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (193582 ms), confidentiality-review (235765 ms), spec-provenance-review (281134 ms), desktop-den-sync-review (317148 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (5997d84015139c1d6058db593cf354c129a0435f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Second test run on this head (copied verbatim from the publisher output so both specs stay visible; the sticky comment below holds Test evidence — busy background archive identifies its captured target before consent and stops only that target — ✅ passedSHA 5997d84 · sandbox ref 5997d84 · engine v1 ✅ 0/2 screenshots passed · 0 expectations passed · 0 failed · 0 pending [world] desktop(daytona) · mock(mcp) · workspace(/tmp/openwork-session-archive-1789155391415-7289-a) · [seed:raw] evalIn() ×27 ⚪ UNVALIDATED — 1. busy background archive identifies its captured target before consent and stops only that target artifact 1
⚪ UNVALIDATED — 2. busy background archive identifies its captured target before consent and stops only that target artifact 2
Test run created 2026-09-11T19:34:20.873Z · Source: |
Test evidence — agents see which sessions are working, and an agent's archive of a working session is refused through its own channel while the person keeps a simple confirmation — ✅ passedSHA 5997d84 · sandbox ref 5997d84 · engine v1 ✅ 0/1 screenshots passed · 0 expectations passed · 0 failed · 0 pending [world] desktop(daytona) · mock(mcp) · workspace(/tmp/openwork-session-archive-1789154923145-68005-a) · [seed:raw] evalIn() ×22 ⚪ UNVALIDATED — 1. agents see which sessions are working, and an agent's archive of a working session is refused through its own channel while the person keeps a simple confirmation artifact 1
Test run created 2026-09-11T19:26:46.623Z · Source: |
|
Verification update for head
Both Daytona sandboxes were created and deleted by the runner. Local: app contract 15/15, server plugin 36/36, |
Signed-off-by: Guillaume Loret <[email protected]>



Split of #4893 (2026-09-11): this PR carries everything Warden can self-clear. The
session.stopcontrol action (Warden 2AY-HF9, an explicit product decision that needs a human approver) is re-added in a stacked follow-up PR; #4893 is closed as superseded by the pair.Problem and RCA
On 2026-09-11 11:27 a session finished its work and, still inside its own assistant turn, called
session.archiveon itself. The app correctly saw the target as working and opened the "This session is still working" confirmation. Three things went wrong around that correct decision:origin: { sessionId }to every bridged command and the control provider hands it to actions ashelpers.origin, butsession.archive'sexecuteignored it. The modal could not tell that requester == target.session.list_sessionsreturned{sessionId,title,workspace,updatedAt,pinned}andsession.readonly the transcript; the activity store's idle/thinking/responding/waiting state was never exposed, so an agent could not check before archiving.apps/server/src/ui-control.tsresolves "The OpenWork window did not answer within 5 seconds" when the window has not replied; the archive promise settles only when the dialog closes. A human-gated dialog can never answer in 5 s, so the agent saw a generic transport error while the dialog stayed open.Related: #4832, #4818, #4825, #4840, draft #4843.
What changes
Principle (product decision, 2026-09-11): the warning goes back through the channel the request came from. The person gets a dialog; an agent gets a structured result in its own conversation, never a dialog.
session.list_sessionsentries carrystatus(activity store: idle/thinking/responding/waiting/compacting/error) andworking.session.readcarriesstatus(engine: idle/busy/retry/waiting) andworking; an unreadable probe reportsworking: true, never a false "safe". Affordance descriptions tell agents to checkworkingfirst.session.archive. On a working target the bridge returns{ ok:false, code:"target_working", sessionId, title, hint }— the hint says: if the user wants it closed, ask them to stop it in the app, then archive onceworkingis false; otherwise leave it running. A session archiving itself or its parent mid-turn getscode:"self_archive_while_working"— "finish the turn; the reviewer archives". No dialog, no 5 s stall, no deferral/queue. Idle targets archive as before. Action-suppliedcode/hintpropagate through the bridge (packages/typesfailure enum + optionalhint); actions learn the channel viahelpers.bridged.session.archive. The confirmation (fix(app): leave archived sessions and explicitly stop active work #4640/fix(app): identify working sessions before stop and archive #4832) is kept but simplified: "This session is still working: <title>" / "Stop the current task and archive?" / Keep session open · Stop and archive. Workspace/id rows and the consequences paragraph are removed.window.confirm-gated actions such assession.delete).cross-chat-memory.mdxgains "How agents manage other sessions" (check status, then archive; stopping stays with the person).Not in this PR
session.stop { sessionId }(the Stop button for any loaded session by id, no confirmation, attribution as the safeguard). It is the only part of #4893 Warden flagged (2AY-HF9 / NLX-3N2) and it is an explicit product decision the user wants a human to approve, so it lives in its own stacked PR on top of this one. Thetarget_workinghint here therefore sends the agent back to the person instead of tosession.stop; the stacked PR restores thesession.stopwording.Verification
Head:
5997d8401(the four #4893 commits + one signed, signed-off commit that removessession.stop).bun test --isolate tests/session-archive-agent-contract.test.tsx tests/notification-store.test.ts(apps/app)bun --conditions=development test src/opencode-plugins/openwork-extensions-preview.test.ts src/opencode-plugins/openwork-provider-adapters.test.ts(apps/server)pnpm evals:pr specs/session-list-sessions-inventory.test.tstsc --noEmitin apps/app, apps/server, packages/typesgit diff --check origin/dev...HEADpnpm evals:e2e session-archive-agent-requester(OPENWORK_EVAL_DAYTONA=1 OPENWORK_EVAL_REF=5997d8401…)refMismatch: false(evidence comments)pnpm evals:e2e session-archive-confirmation-identity(same env)refMismatch: false(evidence comments)The e2e spec drives the real bridge (
POST /experimental/ui-control/requestwithorigin): two real held tasks;list_sessionsreportsworking; archiving working B from A2 returnstarget_workingin < 5 s with no dialog and nothing stopped; A1 archiving itself returnsself_archive_while_workingwith no dialog;session.stopis not advertised; the person's own sidebar click shows the simplified confirmation and Keep leaves B running; idle bridged archive completes.session-archive-confirmation-identitycovers the simplified dialog, duplicate/blank/long titles, no mutation before consent, and B-only stop with Undo.