Skip to content

feat(ui): confirm before archiving or deleting conversations with automations - #184818

Merged
jalehman merged 4 commits into
mainfrom
openclaw-ec5/archive-automation-confirm
Oct 26, 2026
Merged

jalehman merged 4 commits into
mainfrom
openclaw-ec5/archive-automation-confirm

Conversation

@jalehman

@jalehman jalehman commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Archiving or deleting a conversation pauses the automations bound to it, but the Control UI archives with no warning, so users find out only when a scheduled job stops running.

User Impact

User impact: before archiving or deleting a conversation that has an enabled bound automation, the Control UI shows a confirmation that names those automations and says they will pause. Users choose Cancel or Archive anyway / Delete anyway. Conversations without automations keep the current flow: archive with Undo and no dialog, and the existing delete confirmation.

Pause behavior does not change.

Why This Change Was Made

Session rows already carry hasAutomation, the flag behind the sidebar clock badge. When a target row has it set, the UI names the jobs with the existing session-filtered cron.list read (sessionKey + sessionAgentId, enabled: "enabled", compact). There is no new Gateway method. If that read fails or isn't permitted, the dialog still warns, just without names.

The warning is merged into any confirmation that would already appear: the active-work confirm, the nested-tree choice (which keeps Archive all and Archive only this session), the offline nested-archive confirm, and every delete confirm. It is never skippable, so it still shows if the user turned off delete confirmations. When no target has an automation, the existing dialogs open at the same point in the flow as before.

Visibility: each warning logs [session-automation-confirm] <archive|delete> shown to the browser console, then confirmed or cancelled. The log includes the automation count, never names. The Gateway already logs the jobs it disables on archive.

Covered entry points: sidebar and chat-header single archive, sidebar batch archive, nested-tree archive, Sessions page archive, sidebar and chat-header delete, sidebar batch delete, and Sessions page single and selected delete.

Accepted edge cases
  • Dialog copy only states that the listed automations will pause. It names no CLI commands; a native resume path in the UI will be a separate feature.
  • Sessions page "Delete selected" reads the automation flag from the current roster row for the captured session ID, so a conversation that gains an automation after it was selected still gets the warning.
  • Bulk targets are read in parallel, with up to 10 names per conversation. Any remaining jobs are counted, not named.
  • "Delete all archived" does not warn: archiving already paused those jobs.

Evidence

Before (main): archiving a conversation with an automation gives no warning, only the Undo toast.

before

After, sidebar archive:

after sidebar

After, Sessions page archive:

after sessions page

  • pnpm tsgo:ui: clean

  • oxlint on the changed files: 0 warnings, 0 errors. run-format --check: clean. pnpm ui:i18n:verify: clean.

  • vitest --config ui/vitest.config.ts ui/src/components/session-organizer ui/src/pages/sessions ui/src/pages/chat/chat-pane-session: 27 files, 404 tests passed. New unit tests cover: named warning with cancel and confirm (and their log lines), no dialog and no cron.list without automations, warning when the read fails, the nested-tree choice, and the delete warning shown even after opting out of delete confirmations.

  • pnpm test:ui:e2e on the new session-management.archive-automation suite plus the existing archive, delete, nested-archive, archive-batch and bulk-delete-scope suites: 6 files, 25 tests passed. The new suite exercises Cancel → no patch, then Archive anyway → sessions.patch {archived: true}, from the sidebar and from the Sessions page. A third test checks that a conversation without automations archives with no dialog and no cron.list read.

  • Autoreview (Claude engine, branch vs origin/main, P2): scoped-clean, no actionable findings.

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L labels Oct 26, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR warns users before archiving or deleting conversations with enabled automations.

Example: Archive “Nightly owner,” which has the enabled “Nightly digest” automation.

  • Before: The conversation archives immediately and its automation pauses without warning.
  • After: A dialog names “Nightly digest (nightly-digest)” and offers Cancel or Archive anyway.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused, useful change with inspected UI proof, preserved lifecycle safeguards, and the previous finding resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser screenshots show the shared warning naming Nightly digest before archive from both sidebar and Sessions page; matching browser scenarios cover cancellation and confirmation with a mocked Gateway, while focused owner tests cover delete opt-out, unavailable names, nested choices, and refreshed selection metadata.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users can archive or delete a conversation without realizing that its enabled automations will pause.
Reason: The maintainer-directed warning exposes a consequential existing behavior, combines with existing dialogs, and preserves immediate archive for conversations without automations.

Merge readiness

✅ Ready for maintainer review

The earlier selected-delete finding is fixed, and no actionable defects remain in this PR; pending CI still needs to complete.

Priority: P2
Reviewed head: 030fc1eb5079038c5b1b4c62d44707b5151f8083

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI session actions consume Gateway session metadata, optionally read bound automation names through cron.list, and present confirmation before existing archive or delete operations.

flowchart TD
  A[Sidebar and chat header] --> C[Session action owners]
  B[Sessions page] --> C
  C --> D[Shared automation notice]
  D --> E[Scoped cron list read]
  D --> F[Existing confirmation dialog]
  F --> G[Existing session mutation]
Loading

Technical review

Best possible solution:

Keep the shared automation warning integrated with existing confirmations and leave native resume to its separate follow-up.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes the missing idle-archive warning, supported by the supplied before screenshot; no target code was executed during this review.

Is this the best way to solve the issue?

The change uses existing session metadata, scoped cron reads, and confirmation owners, covering the affected callers without adding persistent state or changing pause behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cfb41dddac89.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 3dc03f9 adds ui/src/components/session-organizer-operations.runtime.ts:238 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3dc03f926550; files: ui/src/components/session-organizer-operations.runtime.ts)

PR surface

Source +323, Tests +286, Docs +2. Total +611 across 14 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 8 362 39 +323
Tests 5 307 21 +286
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 671 60 +611

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a focused usability improvement that makes an existing automation-pause consequence visible before users commit the action.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-26T17:10:02.025Z sha c0bf6d0 :: needs changes before merge. :: [P2] Read current automation metadata for selected delete targets

Reviewed October 26, 2026, 3:12 PM ET / 19:12 UTC (Revision 2).

@jalehman

Copy link
Copy Markdown
Contributor Author

Addressed the P2 "Read current automation metadata for selected delete targets" in e9ddedf.

  • Fix: the Sessions page delete confirmation now takes hasAutomation from the current roster row with the same key and sessionId. If there is no such row, it falls back to the captured selection copy. Selection identity and the existing confirmation checks are unchanged.
  • Regression test: sessions-page.test.ts › "warns about automations added to a selected conversation after selection". It selects a conversation without automations, publishes a refreshed row for the same incarnation with hasAutomation: true, runs Delete selected, and asserts the dialog is the automation warning (Delete anyway) and that nothing is deleted. It fails without the fix and passes with it.
  • Related hardening: a cron.list response with no jobs array no longer throws in the warning path. The warning still shows, just without names.
  • Sidebar batch archive/delete: not affected. The sidebar keeps selected keys and reads the current visible rows when the menu action runs (selectedVisibleSessions). Single deletes and archives from Sessions page row menus also receive the live row.

Evidence: pnpm tsgo:ui and oxlint are clean. vitest on session-organizer, pages/sessions and chat-pane-session: 404 tests pass. UI e2e on the archive-automation, archive, delete, nested-archive, archive-batch and bulk-delete-scope suites: 25 tests pass.

@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Head 030fc1e: removed the CLI re-enable copy, fixed the P2 (selected deletes now read the current automation flag for the captured session incarnation, with a regression test), and fixed test typings that failed check-test-types.

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 26, 2026
@jalehman
jalehman merged commit 989db0f into main Oct 26, 2026
94 checks passed
@jalehman
jalehman deleted the openclaw-ec5/archive-automation-confirm branch October 26, 2026 19:54
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…omations (openclaw#184818)

* feat(ui): confirm before archiving or deleting conversations with automations

* fix(ui): drop CLI re-enable hint from archive automation warning

* fix(ui): read current automation flag for selected session deletes

* test(ui): fix archive automation test typings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant