Skip to content

feat(ui): send new-session drafts to background sessions [AI-assisted] - #128050

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/find-session-about-x-video-web-ui-feature
Aug 31, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/find-session-about-x-video-web-ui-feature

Conversation

@clawsweeper

@clawsweeper clawsweeper commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #128037

Related: #80901, #81946, #84827, #123247

What Problem This Solves

The Control UI New Session page could only start a draft by navigating into the created session. Operators could not launch independent work from an empty New Session draft, remain on /new, and receive an actionable completion notice.

Existing Chat behavior is intentionally unchanged: when a session already exists and a run is active, Cmd/Ctrl+Enter continues to use Steer now.

Why This Change Was Made

On the New Session page, Cmd/Ctrl+Enter now reuses the canonical DraftSubmissionFlow for local, cloud-profile, and paired-device placement. It preserves the selected agent, model, reasoning level, prompt, attachments, and placement owner. The draft clears after accepted creation, the page remains on /new, and the created session appears through the existing session list flow.

For operators whose send preference is Modifier+Enter, Cmd/Ctrl+Enter retains ordinary submit and Cmd/Ctrl+Shift+Enter starts the background session. The composer exposes both chords through its accessibility metadata.

The completion notice waits for the exact started turn through the existing agent.wait contract. The shared toast host owns FIFO sequencing, so unrelated notices retain their normal replacement priority. No second Gateway event subscription, lifecycle tracker, or protocol surface is added.

User Impact

  • New Session page, default preference: Cmd/Ctrl+Enter creates and starts the draft in the background without navigating away.
  • New Session page, Modifier+Enter preference: Cmd/Ctrl+Enter starts normally; Cmd/Ctrl+Shift+Enter starts in the background.
  • Local, cloud-profile, and paired-device placement: all retain /new and report completion consistently.
  • Existing session with an active run: Cmd/Ctrl+Enter keeps the existing Steer now behavior.
  • When the background first turn ends, a top-right notice offers Open session navigation to the created session.
  • Normal Start session behavior, draft placement, attachments, and terminal launch remain unchanged.

Evidence

Exact-head desktop recording: New Session draft → background session → completion toast → Open session.

background-desktop-68b2f497.webm

Exact-head mobile recording:

background-mobile-68b2f497.webm
Desktop background completion Mobile background completion
Desktop New Session page showing the completed background session and Open session action Mobile New Session page showing the completed background session and Open session action
Desktop opened background session Mobile opened background session
Desktop chat rendered after opening the completed background session Mobile chat rendered after opening the completed background session

Validated at exact head 68b2f4972397cf3f2a5bb8c8f80614c7bd7f0142, rebased onto e2c92fce4d8bb32ddadf1150e663013c2ad92095:

  • Focused owner tests: 101 passed (19 Code Mode persistence tests and 82 New Session/composer/toast tests)./

Worked on by:

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper
clawsweeper marked this pull request as ready for review August 22, 2026 22:35
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Aug 22, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. 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. labels Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 3:01 PM ET / 19:01 UTC.

ClawSweeper review

What this changes

The PR lets the Control UI New Session page start a draft in a separate background session with a keyboard shortcut and later offer an Open action in a completion toast.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for ordinary maintainer review: the exact-head implementation follows the existing session, placement, and Gateway run-wait contracts, and current main does not provide this New Session workflow. The intentional default shortcut remap has an explicit recorded maintainer decision.

Priority: P3
Reviewed head: 68b2f4972397cf3f2a5bb8c8f80614c7bd7f0142

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent with its existing owners and targeted coverage; the supplied visual assets could not be independently opened because the review environment could not resolve github.com.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This bot/maintainer-context PR is exempt from the external-contributor proof gate; its exact-head body also supplies desktop and mobile recording and screenshot links tied to the New Session completion path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This bot/maintainer-context PR is exempt from the external-contributor proof gate; its exact-head body also supplies desktop and mobile recording and screenshot links tied to the New Session completion path.
Evidence reviewed 8 items Introduced surface: The verified merge-base-to-head delta contains the New Session flow, completion watcher, shared-toast queue behavior, docs, and focused tests; it is a 17-file change.
Current main still lacks the feature: Before this PR, Enter handling treated Cmd/Ctrl+Enter as ordinary New Session submission in the default preference; it did not have a separate background-submit path.
Gateway contract alignment: The watcher supplies the exact nonempty run ID required by agent.wait, while the Gateway returns pending for queued runs and preserves terminal details for completed runs.
Findings None None.
Security None None.

How this fits together

The Control UI New Session composer creates a session and starts its initial agent run through the Gateway. This path stays on the New Session page, observes that exact run, and hands completion to the shared toast system.

flowchart LR
  A[New Session draft] --> B[Background shortcut]
  B --> C[Gateway session creation]
  C --> D[Initial agent run]
  D --> E[Exact-run completion watcher]
  E --> F[Queued completion toast]
  F --> G[Open session navigation]
Loading

Before merge

  • Resolve merge risk (P1) - In the default Enter preference, Cmd/Ctrl+Enter changes from ordinary New Session submission/navigation to background start; maintainers have explicitly accepted this compatibility change.
Agent review details

Security

None.

PR surface

Source +254, Tests +323, Docs +1. Total +578 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 11 293 39 +254
Tests 5 342 19 +323
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 636 58 +578

Review metrics

Metric Value Why it matters
Production versus test delta production +282/-39; tests/support +353/-19; docs +1 The feature adds one user-facing session workflow with more focused coverage than production growth.
Default keyboard behavior 1 New Session chord remapped Default-mode Cmd/Ctrl+Enter now starts work in the background rather than performing the prior ordinary submission path.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128037
Summary: This PR is the candidate implementation for the open Control UI background-session workflow request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the signed-off chord remap (recommended)
    Merge with the documented default-mode Cmd/Ctrl+Enter behavior, while Modifier+Enter users retain ordinary submission on that chord.

Technical review

Best possible solution:

Land only with the recorded default-chord policy, documented modifier-mode alternative, and existing completion-path coverage intact.

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

Not applicable: this feature path has source-level coverage for direct and placed starts plus desktop/mobile browser E2E scenarios.

Is this the best way to solve the issue?

Yes: the implementation reuses the canonical session creation, placement startup, agent.wait, and shared toast owners instead of creating a parallel lifecycle.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 72dab3e75198.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The introduced default New Session Cmd/Ctrl+Enter behavior intentionally changes an existing keyboard workflow.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P3: This is an optional Control UI workflow improvement rather than a broken default path.
  • merge-risk: 🚨 compatibility: The introduced default New Session Cmd/Ctrl+Enter behavior intentionally changes an existing keyboard workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This bot/maintainer-context PR is exempt from the external-contributor proof gate; its exact-head body also supplies desktop and mobile recording and screenshot links tied to the New Session completion path.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-31T15:14:41.734Z sha 6649aa64350c0fbd202d7a1ec39d6e92f5832d8a :: needs changes before merge. :: [P1] Resume direct background completion watches after Gateway reconnect
  • reviewed 2026-08-31T15:28:53.430Z sha 757c9e9789b821857acc32a8393ede1b8a527e17 :: found issues before merge. :: [P1] Resume direct background completion watches after Gateway reconnect
  • reviewed 2026-08-31T16:10:46.570Z sha cae3135 :: found issues before merge. :: [P1] Resume background completion watches after Gateway reconnect
  • reviewed 2026-08-31T16:37:54.585Z sha 5414e6f :: found issues before merge. :: [P1] Keep queued background runs under observation
  • reviewed 2026-08-31T16:52:11.856Z sha 5414e6f :: found issues before merge. :: [P1] Keep queued background runs under observation
  • reviewed 2026-08-31T17:04:08.616Z sha c9a7d8a :: found issues before merge. :: [P1] Stop polling when the exact run is no longer observable
  • reviewed 2026-08-31T17:27:07.399Z sha c9a7d8a :: found issues before merge. :: [P1] Treat unobservable run timeouts as terminal
  • reviewed 2026-08-31T18:34:18.663Z sha c9a7d8a :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 22, 2026
@clawsweeper

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the exact-head shared-toast finding in 7e4b9faa454:

  • moved completion FIFO ownership from the feature presenter into the shared toast host;
  • preserved ordinary showToast() replacement priority, so observer/error notices are not displaced by the next queued completion;
  • consolidated the regression at ui/src/lib/toast.test.ts, where the old code failed after the unrelated toast was dismissed;
  • kept the approved shortcut policy: background launch owns Cmd/Ctrl+Enter in default mode, while queue-row Steer remains available.

Verification:

  • node scripts/run-vitest.mjs ui/src/lib/toast.test.ts ui/src/app/app-host.test.ts ui/src/pages/chat/critical-observer-notice.test.ts ui/src/lib/sessions/background-turns.test.ts ui/src/pages/chat/chat-composer-actions.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/chat-send-submit.test.ts — 374 passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.active-run-follow-ups.e2e.test.ts — 7 passed in 19.62s.
  • UI and core-test tsgo lanes, focused oxlint/stylelint, dead-code, assertion-safety, format, i18n, and git diff --check — passed.
  • OPENCLAW_BUILD_ALL_NO_PNPM=1 node scripts/ui.js build — passed all Control UI performance budgets.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output — clean, no accepted/actionable findings.

Repair delta: production +52/-50 (net +2); tests +21/-58 (net -37). The aggregate check:changed --staged wrapper was stopped only after its max-lines guard printed OK but did not exit; the remaining planned checks were run directly above.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 22, 2026
@clawsweeper

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

New exact head e0188326512 also resolves the two failed CI lanes from 7e4b9faa454:

  • checks-ui-e2e (10/12): updated the modifier-mode ARIA shortcut contract and synchronize the existing pointer hit-test with the toast's CSS animation. The exact two failing files now pass 23/23 locally.
  • check-additional-runtime-topology-architecture: extracted SessionBackgroundTurnOutcome into the leaf background-turn-contract.ts; Madge moved from 1 cycle to 0.

Post-fix proof: UI and core-test tsgo passed, focused oxlint/dead-code/assertion-safety passed, the Control UI production build stayed within performance budgets, and fresh autoreview reported no accepted/actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

Copy link
Copy Markdown
Contributor Author

Maintainer product decision: accept the shortcut remap as the intended contract for this feature. This was explicitly signed off before implementation.

  • Default Enter-to-send mode: Cmd/Ctrl+Enter launches the draft in a fresh background session.
  • Modifier-enter mode: Cmd/Ctrl+Enter remains ordinary send; Cmd/Ctrl+Shift+Enter launches a background session.
  • Shift+Enter remains newline.
  • Queue-row Steer remains available; preserving the former default-mode keyboard steering chord is intentionally not part of this design.

The documentation, tooltip, ARIA shortcuts, focused tests, live recording, and E2E coverage all implement this chosen behavior.

@clawsweeper

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The required maintainer product decision is now explicitly recorded at #128050 (comment). Exact-head CI is green at e0188326512f0f6551167084bbac3fe8092cf7ac, including the repaired UI E2E and architecture lanes.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 31, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/find-session-about-x-video-web-ui-feature branch from 5414e6f to c9a7d8a Compare August 31, 2026 16:55
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Addressed the queued-run P1 at exact head c9a7d8a439e820e3c4e52154c21e9f7917457420.

agent.wait now treats both observational timeout and pending as nonterminal. The placed owner-boundary case proves the full reconnect rejection → pending → terminal success sequence with three observations of the same run ID. The 31-test focused flow suite, full check-changed, capture-enabled browser E2E, and fresh autoreview are green.

Worked on by:

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 31, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Please review exact head 68b2f4972397cf3f2a5bb8c8f80614c7bd7f0142; the prior timeout-contract finding is repaired and current-head local/E2E proof is green.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

[Feature]: Control UI background session send with completion toasts

3 participants