Repository navigation
Conversation
|
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. 4 Skipped Deployments
|
…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]>
7c981b7 to
83a6cd7
Compare
Warden review summary — BlockedNative findings: 2. Blocking policy matches before consolidation: 1. 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 (179169 ms), confidentiality-review (244822 ms), spec-provenance-review (337014 ms), desktop-den-sync-review (351799 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. |
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]>
Test evidence — agents see which sessions are working, an agent's archive of a working session is refused through its own channel while the person keeps a simple confirmation, and session.stop is attributed — ✅ passedSHA 7bd7f33 · sandbox ref 7bd7f33 · engine v1 ✅ 0/2 screenshots passed · 0 expectations passed · 0 failed · 0 pending [world] desktop(daytona) · mock(mcp) · workspace(/tmp/openwork-session-archive-1789148460348-72114-a) · [seed:raw] evalIn() ×23 ⚪ UNVALIDATED — 1. agents see which sessions are working, an agent's archive of a working session is refused through its own channel while the person keeps a simple confirmation, and session.stop is attributed artifact 1
⚪ UNVALIDATED — 2. agents see which sessions are working, an agent's archive of a working session is refused through its own channel while the person keeps a simple confirmation, and session.stop is attributed artifact 2
Test run created 2026-09-11T17:39:16.361Z · Source: |
|
For the human approver — state at head
|
|
Superseded on 2026-09-11 by a split so the un-gated value can merge today:
Nothing on this branch was rebased, amended or force-pushed; both new branches start from |
…rough the requester's channel (split of #4893, without session.stop) (#4903) * fix(app): tell agents which sessions are working and who asked to archive 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]> * feat(app): session.stop control action attributed to the requesting agent 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]> * fix(app): route archive warnings back through the requester's channel 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]> * docs: escape the placeholder in the session.stop notification example for MDX Signed-off-by: Guillaume Loret <[email protected]> * fix(app): carry the archive-channel fix without session.stop 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]> --------- Signed-off-by: Guillaume Loret <[email protected]>


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 (it was: the requester was mid-tool-call) and opened the "This session is still working" confirmation. Three things went wrong around that correct decision:origin: { sessionId }to every bridged command (apps/server/src/opencode-plugins/openwork-extensions-preview.tsaffordanceOrigin) and the control provider hands it to actions ashelpers.origin, butsession.archive'sexecute: async (args) => …ignored it (session-control-actions.ts). The modal could not say who asked, and 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 window replies only when the action settles, and 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 (modal names the target), #4818 (toast names the target), #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 }— "if the user wants it closed, call session.stop first, then archive; if not, 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 to the essentials: "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; no requester row (the person just clicked it).session.stop { sessionId }. The Stop button for any loaded session by id (user decision: "an agent should be able to stop a session if a user asks him to do so"). Same trust level assession.create/session.archive, no confirmation: aborts the turn, cancels subtasks and queued messages, no navigation. Idle →{ok:true, alreadyIdle:true}; success →{ok:true, stopped:true, sessionId, title}; unknown id → structured error. Safeguard is attribution: "Session stopped: <title> — Requested by " as a toast and as a notification-center entry with a View action (newopen-sessionnotification action) plus the control-action narration. Reuses the archive path's interruption machinery; v2 preview disabled with its own reason. Not chained into archive.window.confirm-gated actions such assession.delete).Warden NLX-3N2 ("session.stop can interrupt any loaded session without confirmation") describes this decision; it is intentional (attribution, not a gate) and left for a human approver.
Product/design notes
Patterns from comparable products (official docs, 2026-09-11; not a claim of design approval): a state machine visible to the caller before lifecycle verbs (Cursor Cloud Agents
run.status, Devinstatus_detail); stop/cancel as a first-class verb separate from archive (Cursor…/cancel, Devin terminate?archive=true); structured conflicts instead of transport errors (409 agent_busy,run_not_cancellable); initiator attribution on lifecycle events (Slack "X archived this channel", GitHub Actions triggering actor). Docs:packages/docs/start-here/do-work-with-it/cross-chat-memory.mdxgains "How agents manage other sessions".Verification
Head:
7bd7f33e0b1a0c765500f300ab44a085c85bcddb(four commits, all signed and signed off).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=7bd7f33e0…, Infisical injection)refMismatch: falsepnpm evals:e2e session-archive-confirmation-identity(same env)Verdict: Passed. Commit-bound evidence for both Daytona runs on
7bd7f33e0is published in the sticky comment below.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; the person's own sidebar click shows the simplified confirmation (title, one question, no metadata rows) and Keep leaves B running; idle bridged archive completes;session.stopon working B ends its run (aborts only B), notification toast + persisted center entry name target and requester, idempotent second stop, unknown id error.session-archive-confirmation-identityis updated to the simplified dialog and still covers duplicate/blank/long titles, no mutation before consent, and B-only stop with Undo.