Repository navigation
fix(ui): allow direct sessions in non-Git folders - #112433
Conversation
Visual proofCurrent Before: custom /home folder forces WorktreeAfter: non-Git /home folder runs directlyAfter: Git folder offers optional WorktreeArtifact manifest: artifact-manifest.json Links are presigned for seven days; the manifest records file sizes and SHA-256 digests. |
|
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. |
e6f22b8 to
ba9f5ea
Compare
|
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. |
|
Land-ready verification is complete on head Proof:
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. |
|
Merged via squash.
|
* 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



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 checkoutwhen 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, orunavailable).sessions.createremains 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
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.autoreview --mode branch --base origin/main --engine codex --model gpt-5.6-sol --thinking high— clean, no accepted/actionable findings.