Skip to content

feat(projects): wait-for-setup, solenta.json, submodules, branch prefix, clone from URL (#1506 H3) - #1509

Merged
currentbits merged 7 commits into
mainfrom
coder/1506-h3-project-setup-options-74098c
Oct 6, 2026
Merged

currentbits merged 7 commits into
mainfrom
coder/1506-h3-project-setup-options-74098c

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Item H3 of #1506.

What changed

  1. Agent waits for setup (per project). The first run in a new worktree waits for setup and the submodule update, bounded by the existing 30-min timeout. The thread shows "Waiting for setup", and Stop ends the wait without starting the agent. A failed setup says so and starts the agent anyway, matching existing setup-failure handling: the worktree is kept and the log is in the transcript.
  2. solenta.json: { "setup": "...", "quickActions": [{ "name", "command" }] }, validated. An invalid file contributes nothing and shows its error.
    • App settings override the file per field, and file values show "from solenta.json".
    • Security: file commands never run until approved. The approval card lists every command and stores a hash on the project; a change asks again. An unapproved file setup in a new worktree is skipped with a note.
  3. Submodules: git submodule update --init --recursive in new worktrees with .gitmodules, with terminal prompts disabled. Best-effort: a failure warns and setup still runs.
  4. Branch prefix (per project, default coder/). Validated against git's ref rules, with a test comparing against git check-ref-format. Every coder/ match site was audited: placeholder renames keep their original prefix, and startup cleanup covers all project prefixes, merged branches only.
  5. Clone from URL in Add project: https and ssh only, the target must be missing or empty, live progress, and Stop. A failed or stopped clone removes what it created. Also exercised against GitHub for real.

Also: a bug fixed in the shell runner's env handling (the submodule command lost PATH), and one em-dash removed from help text.

Merge with main: resolved additive conflicts with #1504 and #1505 in ipc-projects.js, App.tsx, SettingsModal.module.css, src/dev/projects.ts and fakeCoder.ts (kept both sides).

Verified independently, on main merged with this branch:

  • typecheck exits 0 and vite build passes.
  • test:renderer passes 2814 of 2814.
  • test:electron passes 4271 of 4271.

🤖 Generated with Claude Code

Willem and others added 7 commits October 6, 2026 17:13
ProjectInfo gains waitForSetup, branchPrefix and the derived repoConfig
(solenta.json commands + approval state). runCommand takes
trustRepoConfig. New projects.clone / cancelClone and the clone:progress
push (desktop and web). Dev mock and fake client follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
New worktrees are named <prefix><slug>-<id>, default coder/. The prefix
is validated against git's ref rules. Placeholder renames keep the prefix
the branch was born with, and the orphan sweep tidies branches under
coder/ and every project's prefix (still non-force).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tup (#1506)

- solenta.json setup/quickActions, validated; project settings win per
  field. File commands run only after the user approved their sha256,
  and re-prompt when they change.
- New worktrees run git submodule update --init --recursive when
  .gitmodules exists; failure is a warning event.
- waitForSetup holds the first run in a new worktree ("Waiting for
  setup" step) until setup settles. Failed setup is reported and the
  agent starts anyway, matching existing setup failure handling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
git clone --progress into a missing or empty folder, streaming
clone:progress, with cancel. Whatever the clone created is removed on
failure or cancel, then the project is added as usual.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1506)

Edit project: Agent waits for setup, Branch prefix, and "from
solenta.json" markers with the precedence spelled out. Thread details
list file commands and ask once (listing every command the approval
covers) before the first run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
URL, target folder and optional name, live progress line and Stop clone.
Errors stay in the dialog. runCommand forwards the solenta.json approval
and refreshes projects so the trusted state shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	electron/ipc-projects.js
#	src/App.tsx
#	src/components/SettingsModal.module.css
#	src/dev/projects.ts
#	test/support/fakeCoder.ts
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T15:23:54.826224Z 4010201 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 401020114e

ℹ️ 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".

Comment on lines +278 to +279
const existing = inflight.get(id);
if (existing) return existing;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Queue worktree setup behind an in-flight quick action

When a user starts a never-run thread while one of its quick actions is still running, worktree materialization reaches this branch and returns that quick-action promise instead of scheduling submodule initialization and setup. Because the returned promise was never added to setupJobs, pendingSetup() also returns null, so even with “Agent waits for setup” enabled the agent launches immediately and the actual setup is permanently skipped. Queue the setup after the existing action or otherwise ensure it receives its own setup job.

Useful? React with 👍 / 👎.

Comment thread electron/worktrees-gc.js
Comment on lines +256 to 258
if (branch && appBranchPrefixes(store).some((p) => branch.startsWith(p))) {
// Non-force: an unmerged orphan branch survives as a recoverable ref.
await gitTryAsync(repoPath, ["branch", "-d", branch]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope custom branch cleanup to the owning project

When any project configures a custom prefix, this check applies that prefix to orphan worktrees from every repository in the store. For example, if project A uses release/, sweeping an orphan worktree in project B whose user-created branch is release/1.0 will delete that branch after removing the worktree whenever git branch -d considers it merged. Match repoPath to its owning project and use only that project's app prefixes rather than the global union.

Useful? React with 👍 / 👎.

Comment thread electron/projectClone.js
Comment on lines +203 to +204
push({ line: "Adding project" });
return deps.addProject(target);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clean up the clone when project registration fails

If git clone succeeds but addProject rejects—for example because persisting the project store fails—the clone request still rejects while the newly populated target is left behind. A retry then fails with “Folder is not empty,” contradicting the clone API's cleanup guarantee and forcing manual recovery. Wrap this final registration step so failures invoke the same cleanup used for clone failures, while preserving a pre-existing empty target.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant