Repository navigation
feat(gateway): task-suggestion acceptance modes with compact split-button card - #121173
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
962102f to
311302c
Compare
|
Codex review: found issues before merge. Reviewed August 9, 2026, 1:46 PM ET / 17:46 UTC. ClawSweeper reviewWhat this changesAdds local, cloud-worker, and source-session destinations for accepted task suggestions, plus compact Control UI and TUI controls for choosing them. Merge readiness⛔ Blocked by patch quality or review findings - 7 items remain Keep this protected maintainer feature PR open: two P1 source-proven defects can respectively send unsupported parameters to older Gateways and create an unsteered turn during an active source-session run. Priority: P1 Review scores
Verification
How this fits togetherAgents propose follow-up tasks, while the Gateway claims a suggestion and creates or steers the selected session. The Control UI and TUI negotiate Gateway features, submit the acceptance request, and display the resulting session outcome. flowchart LR
Agent[Agent suggestion] --> Clients[Control UI and TUI]
Clients --> Gateway[Gateway acceptance]
Gateway --> Mode{Execution mode}
Mode --> Worktree[Worktree or local session]
Mode --> Cloud[Cloud worker session]
Mode --> Source[Source-session turn]
Decision needed
Why: This is a new cross-client Gateway workflow, so the final supported capability and compatibility promise require maintainer intent beyond the mechanical repairs. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +553, Tests +644, Docs 0, Generated 0, Other +8. Total +1205 across 29 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Negotiate a server capability for non-worktree acceptance modes, hide those modes until it is present, and require exactly one active run ID before source-session steering. Do we have a high-confidence way to reproduce the issue? Yes, from source: an old Gateway advertising the existing method rejects the new mode field, and an active source session with zero visible run IDs bypasses steering safeguards. Is this the best way to solve the issue? No. Reusing the existing destination seams is sound, but the feature must negotiate the widened protocol and preserve the sibling flow's exactly-one-run steering rule. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 34b8a6515d78. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
311302c to
453a08b
Compare
…tton card
- taskSuggestions.accept gains additive mode (worktree default | local | cloud | session) + cloudProfileId; operator.admin unchanged; worktree requests stay {taskId}-only for older gateways
- local reuses the plain-cwd create; cloud mirrors the Control UI create-empty -> sessions.dispatch -> send sequence with pre-claim profile validation and full rollback; session delivers the prompt into the source session (steer single active run, plain turn when idle, ambiguous refused) and can only cancel the chip on failure, never touch the source session
- Control UI card redesigned per owner reference: repo-basename eyebrow, clamped summary, instructions expander, split button with per-profile cloud items or a disabled "No cloud environment configured" hint
- TUI gains the same modes as selector rows with capability gating and double-Enter arming
Release-note context: operators now choose where an accepted follow-up runs — isolated worktree (default), the project checkout, a configured cloud worker, or as the next instruction in the current session — from a compact suggestion card.
…steerable-run invariant - Gate non-worktree task-suggestion actions on the negotiated Gateway capability. - Require exactly one steerable run ID before delivering into an active source session.
453a08b to
6292896
Compare
|
Merged via squash.
|
…tton card (openclaw#121173) * feat(gateway): task-suggestion acceptance modes with compact split-button card - taskSuggestions.accept gains additive mode (worktree default | local | cloud | session) + cloudProfileId; operator.admin unchanged; worktree requests stay {taskId}-only for older gateways - local reuses the plain-cwd create; cloud mirrors the Control UI create-empty -> sessions.dispatch -> send sequence with pre-claim profile validation and full rollback; session delivers the prompt into the source session (steer single active run, plain turn when idle, ambiguous refused) and can only cancel the chip on failure, never touch the source session - Control UI card redesigned per owner reference: repo-basename eyebrow, clamped summary, instructions expander, split button with per-profile cloud items or a disabled "No cloud environment configured" hint - TUI gains the same modes as selector rows with capability gating and double-Enter arming Release-note context: operators now choose where an accepted follow-up runs — isolated worktree (default), the project checkout, a configured cloud worker, or as the next instruction in the current session — from a compact suggestion card. * fix(gateway): negotiate task-suggestion acceptance modes and enforce steerable-run invariant - Gate non-worktree task-suggestion actions on the negotiated Gateway capability. - Require exactly one steerable run ID before delivering into an active source session.
What Problem This Solves
Task-suggestion cards (
spawn_task) had exactly one acceptance shape: a managed-worktree session. The operator's real question at that moment is not "yes/no" but "yes — and where should this run": an isolated worktree, the project checkout directly, a configured cloud worker, or simply as the next instruction in the session that produced the suggestion. The card also disclosed everything at full size (absolute path, complete prompt), making the tray tall and noisy.Why This Change Was Made
Owner-directed redesign to match the reference card design: compact card —
Suggested task · in <repo>eyebrow (repo basename, full path one click away), clamped summary, instructions behind a "Show instructions" expander, dismiss ✕ — with a split action button: Start with worktree (primary, unchanged default) plus a menu offering Start locally, Send to cloud (one item per configured worker profile; a single disabled item with a "No cloud environment configured" hint when none), and Fix in this session.Every mode maps onto an existing proven seam rather than new machinery:
local→ the plain-cwdsessions.createbranch (spawnedCwd).cloud→ the exact Control-UI cloud sequence: create an empty worktree session,sessions.dispatch {profileId}, then deliver the prompt (create-empty is deliberate for cloud recovery). Profile validity is checked against the samelistWorkerProfilesfactenvironments.listserves, before the chip is claimed or any side effect runs.session→ thesession.suggestionsdispatch precedent: directhandleChatSend, steering the single active run (expectedRunId) or opening a plain turn when idle, refusing when multiple runs are ambiguous. The real operator client is forwarded so the run's task-suggestion delivery-mode handshake holds. A delivery failure cancels the chip back to pending and never touches the operator's source session (invariant commented at the helper).worktree→ byte-for-byte the existing path; clients send{taskId}only for it, so the default action stays compatible with older gateways.All modes ride the existing claim lifecycle (
begin/complete/cancel/abandon), the acceptance dedup map, and the catch funnel that guarantees noacceptingrecord can be stranded (all four routes flow through it).User Impact
mode,cloudProfileIdoptional ontaskSuggestions.accept); result shape unchanged;operator.adminstill gates every acceptance mode.Known tradeoff (named): in cloud mode, if prompt delivery fails after the dispatch became active, rollback can be placement-fenced; the acceptance then fails loudly with the partial-rollback error and the created session stays visible — never a silent outcome. Improving fenced-cloud rollback is a follow-up, not blocked on this PR.
Evidence
src/gateway/server-methods/task-suggestions.test.ts32/32 (per-mode create-params, cloud sequence order, unknown-profile/no-profiles rejected before side effects, dispatch-failure rollback, session-mode idle/steer/ambiguous/missing/archived, delivery-failure cancel-to-pending without session deletion, replay idempotency, schema rejection of invalid modes) — verified independently by the coordinator, not only the implementation run.{taskId}only; list-only regression intact).pnpm ui:i18n:verifygreen afterui:i18n:baseline(new keys are translation-key-only; raw-copy baseline byte-identical).git diff --checkclean.Screenshots
Before
After — collapsed
After — acceptance menu
Owner decision
Multi-destination acceptance is approved as a negotiated public Gateway capability by the repository owner, who directed this feature and the reference design interactively (operator instruction in-session, 2026-08-09); non-worktree modes are capability-gated ("taskSuggestions.acceptModes") so older gateways keep graceful worktree-only behavior.