Skip to content

feat: port upstream #2460 (combine workspace project stack) onto main-fluke#47

Merged
f1uke merged 3 commits into
main-flukefrom
chore/port-2460-workspace-stack
Jul 10, 2026
Merged

feat: port upstream #2460 (combine workspace project stack) onto main-fluke#47
f1uke merged 3 commits into
main-flukefrom
chore/port-2460-workspace-stack

Conversation

@f1uke

@f1uke f1uke commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Ports upstream PR AgentWrapper#2460 – "combine workspace project stack" (7a87caae, ~3,500 lines) onto main-fluke (on top of the batch-1 sync / PR #45). AgentWrapper#2460 adds the workspace-project-stack capability: a project can be a multi-repo workspace whose sessions materialise a root worktree plus one worktree per child repo — all on a shared branch — with SCM observation of child repos, workspace-aware lifecycle teardown, and a desktop import UI.

Every conflict was resolved to keep main-fluke behavior while adding AgentWrapper#2460's capability — reconciled, not one-sided.

Verification

Check Result
go build ./... / go vet ./... ✅ clean
golangci-lint run 0 issues
go test ./... ✅ green in every package the port touches
tsc --noEmit (frontend) ✅ clean
vitest run (frontend) 661/661
Sidebar import UI ✅ demoed via ao preview (screenshots below)

Two backend failures are pre-existing/environmental in packages this port never touches: internal/cli e2e give the documented spurious HTTP 404 when run inside a live AO session (real daemon AO_* env leaks in — confirmed present), and one kilocode auth test context deadline exceeded that passes on isolated re-run (transient timeout).

Conflict hot-spots & reconciliations

manager.go (spawn / kill / restore rewrite, +737 upstream — 5 conflicts)

  • Spawn branch naming — kept main-fluke's AI branch-naming + per-project git-convention prefix (applyConventionPrefix) + auto-named-collision retry; routed provisioning through feat: combine workspace project stack AgentWrapper/agent-orchestrator#2460's createSessionWorkspace and the workspace-aware defaultSpawnBranch (delegates to main-fluke's defaultSessionBranchao/<id>/root for regular projects).
  • --base overridecreateSessionWorkspace hardcoded the project default branch; threaded main-fluke's cfg.BaseBranch back through it (both the regular and workspace paths).
  • Restore — the extracted relaunchRestoredSession dropped RuntimeConfig.ProjectID/Branch; restored them (they feed tmux.SessionNameFor, i.e. the per-project branch naming), using the in-scope rec.ID.
  • reconcileLive — kept main-fluke's idle-close-TTL fast-path; delegated the not-idle capture to feat: combine workspace project stack AgentWrapper/agent-orchestrator#2460's workspace-aware saveAndTeardownOne (behaviorally equivalent to the old inline stash+marker+destroy, and multi-repo aware).
  • System prompt — kept prompts.ConfidentialityGuard + effectiveBase (main-fluke's prompts-package refactor) and added feat: combine workspace project stack AgentWrapper/agent-orchestrator#2460's workspaceProjectPrompt injection; dropped upstream's re-introduced local systemPromptGuard const (verbatim duplicate of ConfidentialityGuard) and the now-dead orchestratorPrompt.

observe/scm/observer.go (PR attribution)

Sidebar.tsx (+464 upstream — 8 conflicts)

  • main-fluke had inlined CreateProjectFlow into the sidebar and deleted the standalone CreateProjectFlow.tsx → kept it deleted.
  • Ported feat: combine workspace project stack AgentWrapper/agent-orchestrator#2460's full multi-step import flow (mode picker → folder picker + repo scan/validation → agents) into the inlined component; all supporting infra (preload/bridge scanImportFolder/chooseDirectory(title), _shell asWorkspace wiring, API) was already present via clean auto-merge.
  • Dropped the create-flow sr-only error span (a minor main-fluke a11y touch): it duplicated the error text and is incompatible with upstream's multi-dialog flow + tests, which surface errors visibly in both dialogs. The unrelated project-removal sr-only span is untouched.

_shell.tsx — kept main-fluke's throw on orchestrator-startup failure; upstream's setOrchestratorStartupError state path isn't wired in main-fluke's shell (undefined reference).

Lockfilepackage-lock.json is secondary (pnpm is primary); took AgentWrapper#2460's transitive @emnapi bump. pnpm install churn on pnpm-lock.yaml was reverted to the merged state.

Related PRs

Demo

ao preview of the new import flow (mock-data renderer):

  1. "Import to Agent Orchestrator" mode dialog — Workspace (multi-repo) vs Project (single-repo).
  2. "Import workspace" folder dialog — folder picker + detected-repo validation.

Both render with main-fluke's design system.

🤖 Generated with Claude Code

Fluke Sattra and others added 3 commits July 10, 2026 13:57
…k) onto main-fluke

Ports upstream PR AgentWrapper#2460 (7a87caa, ~3,500 lines) which adds the
workspace-project-stack capability: a project can be a multi-repo
workspace whose sessions materialise a root worktree plus one worktree
per child repo, all on a shared branch, with SCM observation, lifecycle
teardown, and a desktop import UI.

Every conflict was resolved to KEEP main-fluke behavior while ADDING
AgentWrapper#2460's capability. Key reconciliations:

- manager.go spawn: kept AI branch-naming + per-project git-convention
  prefix + auto-named-collision retry; routed through AgentWrapper#2460's
  createSessionWorkspace and workspace-aware defaultSpawnBranch. Threaded
  main-fluke's --base (cfg.BaseBranch) override into createSessionWorkspace
  (upstream hardcoded the project default).
- manager.go restore: kept main-fluke's RuntimeConfig ProjectID/Branch
  (feed tmux SessionNameFor) inside the extracted relaunchRestoredSession.
- manager.go reconcileLive: kept main-fluke's idle-close-TTL fast-path;
  delegated the not-idle capture to AgentWrapper#2460's workspace-aware
  saveAndTeardownOne.
- manager.go buildSystemPrompt: kept prompts.ConfidentialityGuard +
  effectiveBase (main-fluke prompts-package refactor), added AgentWrapper#2460's
  workspaceProjectPrompt injection; dropped upstream's duplicate local
  systemPromptGuard const and dead orchestratorPrompt.
- observer.go: kept main-fluke's live-branch PR attribution AND
  subjectRepoForPR Owner/Name hydration; added AgentWrapper#2460's workspace
  child-repo scanning + multi-repo repoForTrackedPR selection. Composed
  the two (repoForTrackedPR selects, subjectRepoForPR hydrates) so
  upstream AgentWrapper#2510 is redundant; favor main-fluke's non-drop on no-match.
- Sidebar.tsx: ported AgentWrapper#2460's full workspace-import UI flow (mode →
  folder+scan → agents) into main-fluke's inlined CreateProjectFlow;
  dropped the create-flow sr-only error span (duplicated error text,
  incompatible with upstream's multi-dialog tests). Kept the standalone
  CreateProjectFlow.tsx deleted (main-fluke inlined it).
- _shell.tsx: kept main-fluke's throw on orchestrator-startup failure
  (upstream's setOrchestratorStartupError state is not wired in main-fluke).

Not taken: AgentWrapper#2510 (Owner/Name hydration) — redundant, subjectRepoForPR
already hydrates. AgentWrapper#2497 (Kimi/Qwen prompt-delivery refactor) — recommended
as a follow-up (independent concern, re-touches manager.go).

Backend: go build/vet/test ./... green (except the documented in-session
CLI e2e 404s and a transient kilocode timeout, both in untouched
packages); golangci-lint 0 issues. Frontend: tsc clean, 661 vitest green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The cherry-pick left frontend/package-lock.json internally inconsistent —
@rolldown/binding-wasm32-wasi pinned @emnapi/core/runtime at 1.10.0 while
requiring exactly 1.11.1 — so `npm ci` failed the package.json↔lock sync
check. Regenerated the lockfile (npm install --package-lock-only), a
targeted fix of the @emnapi/rolldown subtree only.

The auto-merge also left preload.ts, ProjectSettingsForm.tsx, and
types/workspace.ts unformatted; ran prettier@3 --write (cosmetic only).

Frontend: tsc clean, 661 vitest green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The previous commit reformatted types/workspace.ts with a prettier run that
did not resolve the repo's root .prettierrc (printWidth 120), so it wrapped
the WorkerDisplayStatus union under the default width 80 — which CI's
root-run prettier@3 then rejected. Restored the auto-merged version (which
CI accepted); verified with the exact CI command from the repo root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@f1uke f1uke merged commit 97ac3d0 into main-fluke Jul 10, 2026
10 checks passed
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