Skip to content

fix(ui): allow direct sessions in non-Git folders - #112433

Merged
steipete merged 4 commits into
mainfrom
steipete/wizardly-shirley-99e8b5
Jul 22, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/wizardly-shirley-99e8b5

Conversation

@steipete

@steipete steipete commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #112242

What Problem This Solves

Fixes an issue where users selecting an ordinary custom Gateway folder on the New session page would have managed-worktree mode forced on and then see agent workspace is not a git checkout when starting the thread.

This blocked bootstrap workflows such as starting in a home directory, cloning a repository, and then asking the agent to inspect it.

Why This Change Was Made

The unified Place picker now treats working directory and Git isolation as separate decisions. A custom Gateway folder runs directly by default; the picker offers Worktree only after the Gateway confirms that the folder is Git-backed. Cloud placement remains worktree-required, and paired nodes remain worktree-free.

The Gateway owns the capability decision through an additive typed status on worktrees.branches (git, not_git, or unavailable). sessions.create remains the final authority for admin scope, absolute paths, sandbox containment, and managed-worktree validation. Transient or unavailable Git inspection never silently changes an explicit isolation choice: configured Git workspaces preserve it, while unsafe custom worktree/cloud submission stays blocked until capability is known.

No protocol version bump, config surface, SQLite change, migration, or compatibility fallback was added.

User Impact

Users can start Gateway-local threads directly in non-Git folders. Git-backed folders still offer optional isolated worktrees with base-branch and name controls. The folder browser, recent Places, Gateway naming, node selection, and cloud recovery behavior remain in the current unified Place picker.

AI-assisted implementation and review; the final branch was reviewed with Codex autoreview and validated against the running Control UI.

Evidence

  • Visual before/after proof: fix(ui): allow direct sessions in non-Git folders #112433 (comment) (desktop non-Git folder plus narrow Git-worktree state and SHA-256 manifest).
  • node scripts/run-vitest.mjs packages/gateway-protocol/src/schema/worktrees.test.ts src/agents/worktrees/service-branches.test.ts src/agents/worktrees/service.test.ts src/gateway/server-methods/worktrees.test.ts src/gateway/server.sessions.create.test.ts ui/src/pages/new-session/create-params.test.ts — 123 focused assertions passed.
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test:ui:e2e ui/src/e2e/new-session-page.e2e.test.ts — 38/38 browser scenarios passed.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed — passed. Blacksmith Testbox provisioning was unavailable, so trusted-source policy used the local fallback.
  • pnpm build — passed; Control UI startup bundle remained within performance budgets.
  • pnpm protocol:check — passed; generated Swift/Kotlin/schema artifacts are current and the protocol since guard is unchanged.
  • Final autoreview --mode branch --base origin/main --engine codex --model gpt-5.6-sol --thinking high — clean, no accepted/actionable findings.

@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: L maintainer Maintainer-authored PR labels Jul 21, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Visual proof

Current main forces Worktree for a custom /home folder. The candidate keeps ordinary folders direct and exposes Worktree only for a confirmed Git checkout. The narrow capture also verifies the Place popover remains contained on phone width.

Before: custom /home folder forces Worktree

Before: custom /home folder forces Worktree

After: non-Git /home folder runs directly

After: non-Git /home folder runs directly

After: Git folder offers optional Worktree

After: Git folder offers optional Worktree

Artifact manifest: artifact-manifest.json

Links are presigned for seven days; the manifest records file sizes and SHA-256 digests.

@steipete
steipete marked this pull request as ready for review July 22, 2026 00:58
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(ui): allow direct sessions in non-Git folders This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete force-pushed the steipete/wizardly-shirley-99e8b5 branch from e6f22b8 to ba9f5ea Compare July 22, 2026 01:48
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(ui): allow direct sessions in non-Git folders This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification is complete on head ba9f5ea215ad78dc5d6a3fb93fe18c4b72b8e971.

Proof:

  • node scripts/run-vitest.mjs packages/gateway-protocol/src/schema/worktrees.test.ts src/agents/worktrees/service-branches.test.ts src/agents/worktrees/service.test.ts src/gateway/server-methods/worktrees.test.ts src/gateway/server.sessions.create.test.ts ui/src/pages/new-session/create-params.test.ts — 123 focused assertions passed.
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test:ui:e2e ui/src/e2e/new-session-page.e2e.test.ts — 38/38 browser scenarios passed, including confirmed non-Git, Git-optional isolation, configured-workspace unavailable fallback, and blocked custom local/cloud unavailable paths.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed — passed under the trusted-source local fallback after Blacksmith provisioning timed out.
  • pnpm build — passed; Control UI startup performance remained within budget.
  • pnpm protocol:check — passed.
  • Final Codex branch autoreview — clean, no accepted/actionable findings.
  • Visual before/after proof and SHA-256 manifest: fix(ui): allow direct sessions in non-Git folders #112433 (comment)

Exact-head hosted CI is green:

Known proof gap: none for the touched behavior. Blacksmith Testbox was unavailable during local pre-push proof, but the final exact-head hosted checks, full browser suite, changed-file gate, and build all passed.

@steipete
steipete merged commit 6c3caa3 into main Jul 22, 2026
120 checks passed
@steipete
steipete deleted the steipete/wizardly-shirley-99e8b5 branch July 22, 2026 02:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
* fix(ui): allow direct sessions in non-Git folders

* test: align New Session fixtures with place picker

* fix(ui): preserve worktree intent on Git probe failures

* fix(types): keep worktree status alias internal
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 size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New session fails in custom non-Git Gateway folders

1 participant