Skip to content

feat(app): session.stop by id, attributed to the requesting agent (gated remainder of #4893) - #4904

Closed
yomgui wants to merge 1 commit into
fix/agent-archive-working-sessions-statusfrom
feat/session-stop-by-id
Closed

yomgui wants to merge 1 commit into
fix/agent-archive-working-sessions-statusfrom
feat/session-stop-by-id

Conversation

@yomgui

@yomgui yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member

Stacked on #4903 (the un-gated half of #4893). This PR is exactly the part of #4893 that Warden flagged (2AY-HF9, previously NLX-3N2: session.stop can interrupt any loaded session without confirmation) and therefore the only part that needs a human approving review. Its tree is byte-identical to #4893's head 7bd7f33e0; #4893 is closed as superseded by #4903 + this PR.

What it adds (296 lines, one feature)

session.stop { sessionId } — the Stop button for any loaded session by id. User decision (2026-09-11 12:35): "an agent should be able to stop a session if a user asks him to do so", same trust level as session.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. Not chained into archive.
  • Safeguard is attribution, not a gate: "Session stopped: <title> — Requested by The agent in "" " as a toast and as a notification-center entry with a View action (new open-session notification action), plus the control-action narration.
  • Reuses the archive path's interruption machinery (stopOnly in use-session-archive.tsx); v2 preview disabled with its own reason.
  • The target_working hint and the session.archive description point agents at session.stop again ("call session.stop first, then archive"); docs step 2 "Stop when you ask for it" returns.

What Ben is approving

The product decision that an agent may stop another session's work without a confirmation dialog, with attribution as the only safeguard. Everything else in #4893 merges independently through #4903. If the "who may stop whose work" question is re-opened, this PR is the one to park; #4903 does not depend on it.

Verification (head ba8b199e7)

Command Lane Result
bun test --isolate tests/session-archive-agent-contract.test.tsx tests/notification-store.test.ts (apps/app) Local Exit 0: 18 passed (11 contract incl. 3 session.stop cases + 7 store)
tsc --noEmit (apps/app) Local Exit 0
pnpm evals:e2e session-archive-agent-requester (OPENWORK_EVAL_DAYTONA=1 OPENWORK_EVAL_REF=ba8b199e7…) Fresh Daytona queued — published in the sticky comment below

The e2e step this PR owns: an agent stops working B by id from A1 → B's run ends (aborts only B), nothing navigates, toast + persisted notification-center entry name target and requester, second stop is alreadyIdle, unknown id is a structured error. The same spec on #4893's identical tree passed 1/1 on Daytona (7bd7f33e0, refMismatch: false); it is re-run on this head so the evidence is commit-bound.

Merge order: #4903 first, then this (GitHub retargets it to dev when #4903's branch is deleted).

…gent

Stacked on #4903 (the un-gated half of #4893). Restores the session.stop
control action: the Stop button for any loaded session by id, at the same
trust level as session.create / session.archive, with no confirmation.
Product decision (2026-09-11): the safeguard is attribution, not a gate —
"Session stopped: <title> — Requested by <agent session>" as a toast and a
notification-center entry with a View action, plus the control narration.
Idle -> {ok:true, alreadyIdle:true}; unknown id -> structured error; the
target_working hint points agents at session.stop again.

This is Warden finding 2AY-HF9 (stop by id without confirmation) and is
intentional; it needs one human approving review.

Signed-off-by: Guillaume Loret <[email protected]>
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 11, 2026 7:29pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 7:29pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 7:29pm UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 7:29pm UTC

@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

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 — ✅ passed

SHA ba8b199 · sandbox ref ba8b199 · engine v1

✅ 0/2 screenshots passed · 0 expectations passed · 0 failed · 0 pending

[world] desktop(daytona) · mock(mcp) · workspace(/tmp/openwork-session-archive-1789155054413-79651-a) · [seed:raw] evalIn() ×23
[agent] run(session.open)
[probe] eventually(owning composer is ready)
[user] type(composer, "Keep Archive other workspace running for requester proof.", replace) · press(Enter)
[probe] eventually(task reaches held provider)
[agent] run(session.open)
[probe] eventually(owning composer is ready)
[user] type(composer, "Keep Chat A running for requester proof.", replace) · press(Enter)
[probe] eventually(task reaches held provider) · hash
[agent] run(session.list_sessions)
[probe] eventually(both running sessions report working)
[agent] listActions · desktopApi(POST /experimental/ui-control/request)
[user] notSee(text=This session is still working)
[probe] hash
[agent] desktopApi(POST /experimental/ui-control/request)
[user] notSee(text=This session is still working) · hover(testId=sidebar-session-ses_f6e0c63a3ffehQLVzO5pkRHscK) · testId=session-archive-ses_f6e0c63a3ffehQLVzO5pkRHscK · click(testId=session-archive-ses_f6e0c63a3ffehQLVzO5pkRHscK) · see(text=This session is still working) · screenshot · label=Keep session open · click(label=Keep session open) · notSee(text=This session is still working)
[probe] hash
[agent] desktopApi(POST /experimental/ui-control/request)
[user] notSee(text=This session is still working)
[probe] eventually(idle neighbor is archived)
[agent] desktopApi(POST /experimental/ui-control/request)
[user] notSee(text=This session is still working)
[probe] eventually(B's run ends) · hash
[user] see(text=Session stopped: Archive other workspace) · see(text=Requested by The agent in "Chat A" ses_f6e0c63f8ffeXptE2PezX7cCW4) · screenshot
[probe] storage(openwork:notifications:v1)
[agent] desktopApi(POST /experimental/ui-control/request) ×2
[user] notSee(text=This session is still working)
steps 1 ✅ two independent real tasks run while A remains visible (4.6s) · 2 ✅ session.list_sessions tells agents which sessions are working before they touch them (0.5s) · 3 ✅ an agent archiving another working session is refused with target_working: no dialog, no stop, no 5 s stall (3.4s) · 4 ✅ a session archiving itself mid-turn is refused with self_archive_while_working, no dialog (3.3s) · 5 ✅ the person's own click keeps a simple confirmation: title, one question, Keep or Stop and archive (8.0s) · 6 ✅ an agent stops a working other-session by id: its run ends, nothing navigates, and the notification names target and requester (7.8s)
verdict passed · 11 user observations (notSee ×6, see ×3, screenshot ×2) · 12 probes · steps 6/6

⚪ 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 — no visual expectations recorded.

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

  • ⚪ UNVALIDATED — no visual expectations recorded.

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-11T19:28:59.257Z · Source: evals/results/test-runs/2026-09-11T19-28-59-256Z-agents-see-which-sessions-are-working-an-agent-s-archive-of-a-working-session-is/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4904 --test-run 2026-09-11T19-28-59-256Z-agents-see-which-sessions-are-working-an-agent-s-archive-of-a-working-session-is

@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Superseded: GitHub auto-closed this when its stacked base branch was deleted after the base PR merged. Recreated against dev with the same head branch and commits — see the linked PR above in the timeline (#4907 / #4908 / #4909 / #4910 respectively).

This branch was successfully deployed

5 active deployments
staging - packages/docs — ba8b199e Deployed Sep 11, 2026 by mintlify[bot]
Preview – openwork-landing — ba8b199e Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-app — ba8b199e Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-den — ba8b199e Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-diagnostics — ba8b199e Deployed Sep 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant