Skip to content

fix: start suggested follow-ups without requiring a worktree - #139731

Merged
fuller-stack-dev merged 4 commits into
mainfrom
fix/session-first-followups
Sep 6, 2026
Merged

fuller-stack-dev merged 4 commits into
mainfrom
fix/session-first-followups

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where users accepting a suggested follow-up would get a session blocked on Git/worktree setup, even when the task was local debugging or other work that did not need Git. A failed setup could leave the new session retrying its pending worktree before the agent could respond.

Why This Change Was Made

The Control UI and Gateway-backed TUI now offer one action: Start in a new session. Acceptance opens the task in the suggested folder without creating a worktree; the new session is instructed to explain the need and ask the user before creating or switching to one later. Suggestions no longer require a Git checkout, and suggestion-only placement menus and cloud discovery are removed.

Existing RPC placement modes, including the omitted-mode worktree behavior used by shipped clients, remain compatible. Both current clients explicitly request local session creation. This does not repair already-blocked sessions or change explicit worktree creation elsewhere.

User Impact

  • Start the follow-up without choosing execution infrastructure first.
  • Use ordinary folders and continue local troubleshooting despite broken Git metadata.
  • Keep prompt copying, dismissal, duplicate-action protection, and session navigation.

Evidence

Before After
Worktree-first suggestion action Session-first suggestion action
  • Regression tests fail against the original implementation: the UI offers the worktree action, plain folders are rejected, and local task dispatch lacks the ask-before-worktree instruction.
  • 97 focused tests passed across Gateway, agent tool, web UI, and TUI. The Gateway regression uses real session creation and isolated SQLite state, checks plain folders and unavailable Git metadata, and verifies no pending worktree is saved. Agent dispatch is mocked at its boundary.
  • 4 Chromium/mock-Gateway flow tests passed, including the explicit local request and navigation to the new session, session switching, read-only copying, and stacked suggestions. The primary flow was rerun after the light-theme styling correction; captures above were inspected.
  • 3 real-PTY tests passed for starting the suggested task and retaining action ownership across session switches during pending accept/dismiss.
  • UI production bundles built successfully; i18n baseline and boot manifest regenerated.
  • Core, core-test, and UI typechecks passed. Changed-file type-aware lint, Stylelint, formatting, and the remaining schema/storage/auth/import guards passed after correcting issues surfaced by check:changed.
  • Autoreview completed with no accepted findings at its default P0 threshold.

No live Gateway or user session state was changed.

Landing Review

  • Fresh scoped review: 104 tests passed (42 Gateway/tool, 55 UI/TUI unit and lifecycle, 4 Chromium/mock-Gateway, 3 real-PTY), plus a successful production UI build. Both linked screenshots were downloaded and inspected again; the earlier bot capture-fetch gap is resolved.
  • Fresh P2 autoreview raised an older-Gateway capability concern. Tag ancestry and schema inspection show that v2026.8.1, the first stable release with task suggestions, already supports local acceptance. The affected older implementations are pre-release builds, not a retained stable-upgrade contract, so this finding was not accepted. Existing stable RPC modes remain unchanged.
  • The existing CI failure was unrelated suppression-inventory line drift. This branch carries the exact test-only pair already merged in #139651 and #139747, with no suppression added or check weakened. Exact-head hosted CI is required before landing.
  • Evidence limits: captures cover light-theme desktop. Mock-Gateway and fake-backend PTY tests do not establish live provider execution or the agent's later compliance with the worktree-consent instruction.

Shared Teams session and discussion. GitHub and Teams were checked for human comments before landing; none were present.

A later CI run exposed an unrelated main-branch history fixture/type mismatch. That was fixed independently in #139794. Temporary history changes carried while investigating were removed; no history/pagination changes remain in this PR. The final tree is byte-identical to the previously reviewed head with 166 passing local tests. Exact-head CI is rerun against the repaired main baseline.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 6, 2026 04:28
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:52 AM ET / 05:52 UTC.

ClawSweeper review

What this changes

Suggested follow-ups now start in ordinary sessions from the web UI and TUI, support non-Git folders, and defer worktree decisions until later.

Merge readiness

✅ Ready for maintainer review

Keep open: the central improvement remains absent from current main and the latest release. The introduced changes preserve the existing session-creation path and RPC modes; no blocking correctness defect was found.

Priority: P2
Reviewed head: b25bfafec7d7f14c3315dc1572057a96b65e312d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent simplification with focused boundary coverage, preserved RPC behavior, and no actionable introduced defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a MEMBER, so the external-contributor proof gate does not apply. Inspected coverage reaches real session creation with mocked chat dispatch and verifies client navigation through browser/PTY harnesses; the body reports inspected visual captures but explicitly leaves live provider execution and later worktree-consent compliance unproven.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a MEMBER, so the external-contributor proof gate does not apply. Inspected coverage reaches real session creation with mocked chat dispatch and verifies client navigation through browser/PTY harnesses; the body reports inspected visual captures but explicitly leaves live provider execution and later worktree-consent compliance unproven.
Evidence reviewed 10 items Current main still requires Git: The fetched main revision still calls insideGitCheckout during suggestion creation and defaults omitted acceptance mode to worktree. Local acceptance already exists, but cannot bypass the earlier Git-only creation restriction.
Latest-release comparison: Inspection of v2026.9.2 confirms the same Git-only suggestion validation and existing local acceptance branch; the central requested behavior has not shipped in that release.
Canonical creation path and preserved permissions: Local acceptance passes cwd and the prefixed task to sessions.create without worktree=true. Existing source-session authorization, creation authorization, rollback, and duplicate-accept handling remain. The session-creation owner still canonicalizes directories and enforces sandbox containment; no new authority-bearing credential or authorization bypass is introduced.
Findings None None.
Security None None.

How this fits together

Agents submit ephemeral follow-up suggestions to the Gateway, which displays them in operator clients. Accepting a suggestion creates a session and dispatches its initial task through the existing session-creation service.

flowchart LR
  A[Agent follow-up suggestion] --> B[Gateway suggestion registry]
  B --> C[Web UI or TUI]
  C --> D{Operator action}
  D -->|Dismiss| E[Remove suggestion]
  D -->|Start locally| F[Existing session creation]
  F --> G[New session in suggested folder]
  G --> H[Initial task with worktree guidance]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -325, Tests -223, Docs +2, Other 0. Total -546 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 14 98 423 -325
Tests 12 192 415 -223
Docs 3 5 3 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 30 296 842 -546

Review metrics

Metric Value Why it matters
RPC compatibility 4 acceptance modes retained; omitted mode unchanged The client simplification preserves existing explicit placement requests without adding configuration or protocol fields.

Technical review

Best possible solution:

Reuse canonical session creation for local follow-ups, preserve explicit RPC placement contracts, and defer isolation decisions until the task needs them.

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

Yes, at source level: current main rejects a suggestion whose absolute cwd is not a Git checkout. This review did not execute a failing runtime scenario.

Is this the best way to solve the issue?

Yes: the branch reuses existing local-session acceptance and removes the earlier Git prerequisite instead of adding a parallel execution path. Supporting non-Git suggestions also broadens the previously documented capability.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded improvement to an optional follow-up workflow that currently forces unnecessary Git setup.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a MEMBER, so the external-contributor proof gate does not apply. Inspected coverage reaches real session creation with mocked chat dispatch and verifies client navigation through browser/PTY harnesses; the body reports inspected visual captures but explicitly leaves live provider execution and later worktree-consent compliance unproven.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: 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 (1 earlier review cycle)
  • reviewed 2026-09-06T04:34:12.385Z sha 12d1690 :: blocked before merge. :: none

fuller-stack-dev and others added 3 commits September 5, 2026 23:30
Carry the already-merged test-only corrections from #139651 and #139747
so the PR head and GitHub merge-ref use matching suppression line numbers.
No production behavior or suppression count changes.

Co-authored-by: Peter Steinberger <[email protected]>
Carry the existing #139792 repair and its merged #139715 test prerequisite.
The neutral projection state comes from the owning helper, so this fixture
works before and after the main-branch field rename in #139753.
No session-first implementation changes.

Co-authored-by: Peter Steinberger <[email protected]>
Main now contains the fixture correction from #139794. Remove the carried
#139715/#139792 history changes so this branch returns to the previously
reviewed and tested session-first tree, plus the upstream proxy inventory pair.
@fuller-stack-dev
fuller-stack-dev merged commit ca5a9b0 into main Sep 6, 2026
187 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/session-first-followups branch September 6, 2026 05:56
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…w#139731)

Suggested follow-ups now start in a normal session in the Control UI and
Gateway-backed TUI. Remove the placement menu and Git-only suggestion rule;
instruct the new session to ask before creating or switching to a worktree.
Retain existing RPC modes and rollback/ownership safeguards.

Verified plain folders and unavailable Git metadata through real session
creation, UI navigation with a mock Gateway, terminal flows, and inspected
before/after screenshots. Fresh local validation passed 166 tests, including
the unchanged upstream test corrections from openclaw#139651 and openclaw#139747.

Session context: https://team.openclaw.ai/beam/session-first-task-suggestions-openclaw-pr-7fb326346b7a

Release-note context: follow-up suggestions open a usable conversation without
requiring Git or a worktree first. Existing blocked sessions are unchanged.

Co-authored-by: Peter Steinberger <[email protected]>
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 gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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