Skip to content

feat: move a conversation that has no project into one - #202306

Merged
hannesrudolph merged 41 commits into
openclaw:mainfrom
daniel-lxs:move-conversation-into-project
Nov 22, 2026
Merged

hannesrudolph merged 41 commits into
openclaw:mainfrom
daniel-lxs:move-conversation-into-project

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Closes #202268

What changes

On main, moving work from the default workspace into an existing project requires another conversation and a manual transfer of local edits.

Say “let’s work on OpenClaw” in the default workspace. The model moves this conversation into the registered project with session_project. The model can carry out the rest of that message in the project’s managed checkout. For a move-only request, the reply confirms the destination. The conversation keeps its messages. The tool is available by default for eligible sessions, subject to tool policy. The Gateway refuses a second move.

Choose Move to project… in the conversation menu to do the same move yourself. When a matching checkout has file changes, the dialog previews how many will be copied. The project checkout restores those changes before repository setup. The original checkout stays in place, and earlier links still open its files.

Project moves share the checks for active runs, background processes, terminals, and child sessions with PR workspace preparation.

Sandboxed conversations can move with Docker or Podman. For other sandbox backends, the picker explains why the move is unavailable and the Gateway refuses before saving a project or creating a checkout.

Control UI comparison

Captured in the built Control UI with a synthetic project and two file changes. Main screenshot at e309df612e.

Conversation menu on main Project move dialog in this PR
Main conversation menu without a project move action Move to a project dialog showing Changes to 2 files will be copied

Evidence

Live model handoff

The live Qwen3-8B capture at 4b990ab shows the same conversation in Juniper and the release code from its README. The model called session_project and finished the read in the project checkout.

Control UI showing the same conversation in Juniper and the release code returned from its README

Sandbox admission

On 9546f55, an isolated Gateway with a real loopback SSH sandbox showed the Docker or Podman requirement in the picker and refused the direct move request. The session kept its original workspace and ID, had no project worktree, and replied to the next message.

The carry fixture exercises the Docker move handoff after the initiating turn ends. Live Docker and Podman carry remain pending.

Upgrade compatibility on 9546f55

Each published binary created a conversation, saved a user message and reply, and registered Juniper in its own profile. On startup, the Gateway built at 9546f55 loaded that profile. The same conversation then moved into Juniper through the built Control UI and got a new reply. These checks used synthetic repositories and a scripted local model.

Starting release Result
2026.9.37 (extended stable) Passed
2026.10.33 Passed
2026.11.6 Passed

Each run preserved the session ID, both original messages, the project record, and the source commit. Repository setup saw the copied edit. The untracked file survived and the original files stayed in the source checkout.

The Control UI capture shows the same upgrade scenario at 4b990ab.

Control UI after the upgrade showing the released version’s reply, the successful move to Juniper, and the new reply

Build and tests

  • Full build and Plugin SDK declaration budget passed. The declaration graph was 5,284,258 / 5,385,536 bytes.
  • 139 focused tests passed across Gateway moves, worktree carry, sandbox preparation, handoff, tool and prompt behavior, and the Control UI. Core typecheck, scoped lint, and formatting passed.
  • The test-line allocation includes 47 lines for the regression that checks the session and worktree after an SSH move is refused.
  • A paired Qwen3-8B measurement found that the compact project tool description and guidance save 95 input tokens.
  • Shared tool-display metadata keeps direct JSON imports out of startup. A paired build with that change removed put chat boot 136 B over main.

moveSessionIntoProject records the project and a pending checkout on a
conversation that has neither, the same intent a session created in the
project carries. Its next turn opens the checkout through
prepareSessionWorkspaceForRun, so setup scripts, ignored files, sandbox and
context follow the project open path.

A move can name a folder in the conversation's workspace. Its commit starts
the new branch, and its unsaved changes are laid over the checkout. Git
reads that folder inside the conversation's sandbox, or on the host through
the trusted-config view with hooks off, and hands the project one bundle.
Earlier messages keep opening the files they named.

The idle check moves out of PR adoption into describeSessionWorkspaceBlocker
so both callers share it.
A checkout in the conversation's workspace can name Git data elsewhere on the
host through a .git file or objects/info/alternates. The host carry then read
another repository's commits into the project and wrote objects into it.
The carry now requires the checkout's git dir and common dir to resolve
inside the workspace, with no alternates, and refuses with nothing moved.
The opt-in session_project tool lists the registered projects the requester
may use and moves the conversation into one, optionally bringing a checkout's
work along. The move records the project and pending checkout; because the
resumed turn is a session event, which never prepares a pending checkout,
the tool opens it through prepareSessionWorkspaceForRun before resuming.
Conversations with or without a sandbox can move.

The tool is built only when tool policy names it, so agents without a tool
profile do not gain it. The GitHub publication tool construction moves into a
sibling module with it so openclaw-tools.ts stays within its line cap.
…table

core-descriptors.ts is at its line cap, so new core methods could not be
added. Its last rows move unchanged into core-descriptors.appended.ts, which
the main table spreads at its end, keeping the combined order append-only.
The protocol since guard and the protocol-generation scope read both files.
Adds the projects.moveSessionOptions and projects.moveSession protocol
schemas and a "Move to project…" item in the conversation header menu for
conversations outside every project and worktree. The dialog lists the
projects the conversation can move into, says which local work comes along,
and moves it, ending with a toast that names the project and branch.
…into one

projects.moveSessionOptions lists the registered projects the operator may
use, each with the checkouts in the conversation's workspace whose origin is
that project. Git reads them inside the conversation's sandbox, or on the
host through the trusted-config view for a conversation without one.
projects.moveSession records the move; the person's next message opens the
project, as it does for a session created in it, so the dialog's toast says
so instead of naming a branch.
…s own

The move dialog's host listing read HEAD, subject and origin through a .git
file or alternates that could point at another repository on the host. It
now skips any checkout whose git dir or common dir resolves outside the
workspace or that borrows objects through alternates.
@clawsweeper

clawsweeper Bot commented Nov 20, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Maintainer security changes approved

A maintainer approved this revision with an explicit security approval comment.

A later push requires a fresh approval comment for an external contributor's PR.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Adds menu and agent-tool actions that move an unbound conversation into a registered project while preserving history and optionally copying local work.

Example: Ask “Let’s work on Juniper. Read README.md and report its release code.”

  • Before: Continuing in the project requires a new conversation and manual transfer of local changes.
  • After: The same conversation moves into Juniper, reads its checkout, and returns JUNIPER-7C2B.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong behavior and upgrade evidence supports the implementation, but unresolved required-check failures limit validation confidence.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Control UI screenshots show the picker and real-model continuation; detailed discussion records Docker transfer, restart access, native history replay, and permission comparisons through isolated Gateways, with later changes reusing those unchanged behavior paths.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: A conversation that becomes project work currently requires a second conversation and manual transfer of local edits.
Reason: Maintainer authorship supplies direction approval, and preserving the conversation and local work addresses a concrete workflow cost.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: it delivers a useful, maintainer-approved workflow, and no concrete introduced defect was found; landing remains blocked by security approval and unresolved CI failures.

Priority: P2
Reviewed head: 7f3af8509086302b61743b418c27e64243708b56

Before merge

  • Resolve merge risk - The maintainer must establish whether the failing required CI checks are inherited or caused by this PR before landing.
  • Await maintainer action - An authorized maintainer must review and approve the sensitive changes at head 7f3af85 through the enforced security-review gate.

Findings

None.

Agent review details

How this fits together

The Control UI and agent tool submit project-move requests to the Gateway, which authorizes the destination, prepares a managed checkout, commits the existing session’s workspace binding, and resumes conversation work.

flowchart TD
  A[Conversation menu] --> C[Gateway move owner]
  B[Session project tool] --> C
  C --> D[Session and project access]
  D --> E[Managed checkout preparation]
  E --> F[Session workspace commit]
  F --> G[Files and continued conversation]
Loading

Technical review

Best possible solution:

Land the shared Gateway move operation and its UI and tool adapters after CI attribution and current-head security approval.

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

Current-main source and the inspected before screenshot establish the missing general conversation-to-project action; no target code was run during this review.

Is this the best way to solve the issue?

The implementation preserves session identity and reuses existing handoff, project access, managed checkout, and workspace commit owners; the reviewed additions support the requested workflow.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 50ff9d463371.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared Gateway move operation and its UI and tool adapters after CI attribution and current-head security approval.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

  • Shared workspace blockers and historical file ownership keeps the original intent (feat: prepare existing PRs from ordinary chats #178756: Adoption yields the active turn, refuses competing work, and preserves earlier message links in their original workspace.)
  • Completed background process eligibility keeps the original intent (51833f1: Exited, finalized commands must not block workspace adoption merely because their output was never polled.)
  • Unavailable Chat Completions tool history changes intended behavior with a stated reason (fix(ai): replay unavailable historical tools as text #174797: Strict providers reject undeclared native historical tools; this PR retains text projection for remote routes and limits native completed-move replay to local routes with recorded live evidence.)
  • Core method descriptor placement keeps the original intent (0e94d23: The canonical descriptor table owns method metadata and registration; moving its final rows into an appended table preserves order and updates the vintage guard.)
  • Prompt series stability changes intended behavior with a stated reason (4639df3: Prompt series retain their prepared tool surface; this PR explicitly documents a project move as a series boundary that retires the move tool and guidance.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

PR surface statistics unavailable: the file list is incomplete.

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
New capability surface 1 agent tool, 2 Gateway methods, 0 configuration options The menu and tool share one move operation without adding a user setting.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a useful conversation workflow improvement with an existing manual workaround and no established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (22 earlier review cycles; latest 8 shown)
  • reviewed 2026-11-21T23:57:10.581Z sha 609fd65 :: blocked before merge. :: none
  • reviewed 2026-11-22T02:04:17.437Z sha 7e5087d :: blocked before merge. :: [P2] Keep transcript identity checks inside the session-store owner
  • reviewed 2026-11-22T03:10:53.088Z sha b82357b :: blocked before merge. :: [P2] Restrict successful-move instructions to successful receipts
  • reviewed 2026-11-22T03:37:08.469Z sha 4ce9135 :: blocked before merge. :: none
  • reviewed 2026-11-22T04:03:31.285Z sha 4ce9135 :: blocked before merge. :: none
  • reviewed 2026-11-22T06:00:26.814Z sha 9bda1f1 :: blocked before merge. :: none
  • reviewed 2026-11-22T08:04:38.606Z sha a6ef456 :: blocked before merge. :: none
  • reviewed 2026-11-22T19:10:25.947Z sha 283aa11 :: blocked before merge. :: none

Reviewed November 22, 2026, 2:54 PM ET / 19:54 UTC (Revision 23).

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

I checked the live Qwen3-4B runs on 4ce9135 through an isolated OpenClaw Gateway on roobook. In the two-turn run, Qwen moved the conversation to Beta, read PERMISSION-FIXTURE.txt, and quoted otter-4325 slope-0030. A later user message asked what moved, where it went, and what the file said, without giving the project name or the line. Qwen named Beta and quoted the line again with zero tool calls.

I checked the provider request for that second turn. It kept the first user request, the native session_project call under its original ID vsV4OEA7SrD1bJQFnc5hJvdFWPVylRwV, its completed moved result for Beta and the committed branch, the actual read result, and the first answer. The Gateway kept the same session ID and all six first-turn entries in order. session_project was absent from the active tool list.

In the separate handoff runs, Qwen made a native read and quoted the exact fixture contents in 3/3 moved sessions and 3/3 sessions started directly in Beta. All three resumed requests kept the original move ID and the completed result for the committed branch. The unregistered-project run left the session unbound and delivered a refusal to Qwen without success instructions.

I also compared six moved and fresh pairs with the same permission settings. All six matched on permission mode, elevation settings, Gateway tool inventory, and the model's tools and instructions after accounting for checkout paths and session keys. The live calls showed the same approval behavior in the matched checkouts and denied the outside-file read in both Beta sessions. An explicit read-only setting carried through the move and denied /bin/pwd, just as it did in a fresh session explicitly set to read-only. A fresh session at defaults ran it.

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

Pre-existing failure attribution (verified before merge)

All 17 red suites on 7f3af8509086 are pre-existing; none is new at this head. The same 17 suites already failed identically on this PR's previous head 283aa116 (run 45055674817), and openclaw/ci-gate is red only because of them.

Fifteen of them fail the same way on main right now: commit a63a4297 — run 45066392125 fails the same checks-ui-e2e (5/10, 6/10, 7/10) and node shards with identical annotations — the ui/src/e2e/openclaw-id-menu.e2e.test.ts page-event timeout, chat-composer-redesign/native-nav-responsive-layout false-to-true, the cron-failure-repair executionStarted set in src/gateway/server-cron-failure-repair.final-effect.test.ts (already triaged in #197395 on main 8d1e59c2), the "No model is configured" set, the promise-resolved-instead-of-rejecting set, and test/scripts/ci-node-test-plan-hosted-tail.test.ts expecting 'runtime'. The same failures also recur on main 8ab2464737, 19fcba18, and 0632420a.

The other two have no main counterpart because main does not run those suites: checks-node-changed-extensions-bundle-5 — extensions/codex/src/app-server/thread-lifecycle.native-config.test.ts ("refuses an unowned route before native dispatch") fails with promise resolved { threadId: 'unexpected-thread' } instead of rejecting — and checks-node-changed-compact-large-38-1 — a vitest "retained temporary namespace" infra error in agentic-control-plane-agent-chat-hosted-4. Both failed identically on 283aa116, so neither is new at this head.

Codex's triage of run 45059894614 found every failed job to be the same failure as on main or one already triaged. Merged under the maintainer authorized pre-existing-failure exception.

@hannesrudolph

Copy link
Copy Markdown
Member

/allow-security-sensitive-change

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 extensions: codex gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Move a conversation that has no project into one

2 participants