🤖 feat: project-less scratch chats#3723
Conversation
Adds a hidden _scratch system project bucket, kind: "scratch" workspace metadata, app-owned workdirs at ~/.mux/scratch/<workspaceId> on LocalRuntime, capability-gated git UI, sidebar Chats section, command palette + keyboard shortcut entry points, and docs. --- _Generated with `mux` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh` • Cost: `$177.01`_ <!-- mux-attribution: model=anthropic:claude-fable-5 thinking=xhigh costs=177.01 -->
|
@codex review |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ff071a612
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ratch pinned reorder block)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adbb4ed750
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43ca660ba5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51170f1466
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…atch archive preflight test)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b4f158bcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79fa5fb3d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tte action for scratch)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0dc0333d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ally after reload)
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 901f89d907
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 144e14dead
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ac0fa1594
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61ac823957
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds project-less "scratch" chats: lightweight chat workspaces that live outside any project, backed by an app-owned workdir at
~/.mux/scratch/<workspaceId>on the local runtime, with no git and all git UI capability-gated away.Background
Chat state (history, costs, timing, model settings) is already keyed by workspace ID and is project-independent; the only coupling was persistence (
config.projectsbuckets), requiredprojectPath/projectNamemetadata, and a handful of services asserting a project exists. This PR breaks that narrow coupling so users can start a chat without creating or opening a project. Full design rationale, prior-art research, and rejected alternatives are captured in the plan (hidden_scratchsystem bucket mirroring the_multiprecedent, explicitkind: "scratch"discriminant, no silentgit init).Implementation
Persistence: scratch workspaces live in a hidden
_scratchsystem project bucket (projectKind: "system"), keyed by a sentinel constant (src/common/constants/scratch.ts). Metadata keeps requiredprojectPath= per-chat workdir,projectName= "Scratch", plus optionalkind: "scratch"used for all gating (optional keeps downgrade compatibility).Lifecycle:
workspace.createScratchoRPC route creates~/.mux/scratch/<id>and persists the config; removal deletes the workdir only after a strict path-safety check (under scratch root, basename equals workspace ID); a best-effort startup sweep removes orphaned scratch dirs.Runtime: reuses
localruntime; directory ownership (create/delete) lives inWorkspaceService, soLocalRuntime's never-delete semantics stay intact.Backend gating: git status, patch artifacts, and task forking skip scratch workspaces; system message renders a scratch context block instead of project context.
Frontend:
getWorkspaceCapabilities(metadata)helper gates UI; sidebar "Chats" section above project rows; draft-first creation page (ScratchPage) mirroring project creation without branch/trunk/runtime controls; command palette entry + keyboard shortcut;WorkspaceMenuBarshows a Scratch label instead of branch/git controls; Review tab filtered out via the tab registry.Docs:
docs/workspaces/scratch-chats.mdx.Review hardening (11 Codex rounds): policy gate for createScratch (local runtime must be allowed), scratch-aware trust (
isWorkspaceProjectTrusted, shared-execution trust), workdir deletion ownership guard (basename must match the workspace or a task ancestor), capability gating extended to the response-level Fork button, sidebar row fork action, palette create action, and Ctrl+N; scratch draft routes resolve statically after reload; scratch pinned rows reorder as one block; devcontainer preflight skipped for scratch creation.Validation
Risks
projectPathmeans both "config bucket key" and "cwd-ish path"; for scratch these differ (bucket key =_scratchsentinel, metadata path = workdir). AllfindWorkspaceconsumers were audited and covered by rename/archive/remove tests, but this is where regressions would hide._scratchas a system project and filter it from the sidebar; chats become invisible but harmless, and re-upgrade restores them.~/.mux/scratch/<workspaceId>exactly.Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh• Cost:$279.19