fix(agent-manager): preserve cross-project activation

This commit is contained in:
marius-kilocode
2026-08-06 12:18:48 +02:00
parent 38bff349be
commit 69640241ec
3 changed files with 9 additions and 3 deletions
@@ -827,8 +827,8 @@ de es fa fr it ja ko nl no pl ru th tr uk zh zht`) via the `translator` subagent
- No change to `.am-project-item`, `.am-branch-item`, `.am-selector-trigger`,
`.am-nv-config-label`, or any other existing rule. The only existing rule touched is the
`overflow: visible` selector group in E.3, and only by adding selectors to it.
- No new message types. `agentManager.addProject`, `agentManager.requestBranches`,
`agentManager.createMultiVersion`, `agentManager.importFromBranch`, and
`agentManager.importFromPR` all already exist and already accept what is needed.
- No new message types. `agentManager.requestBranches`, `agentManager.createMultiVersion`,
`agentManager.importFromBranch`, and `agentManager.importFromPR` all already exist and
already accept what is needed.
- With `props.projects` empty, the rendered dialog markup must be identical to before the
change. Verify by toggling `kilo-code.new.experimental.multiProject` off.
@@ -4,6 +4,7 @@ import { join } from "node:path"
const root = join(__dirname, "..", "..")
const dialog = readFileSync(join(root, "webview-ui", "agent-manager", "NewWorktreeDialog.tsx"), "utf8")
const app = readFileSync(join(root, "webview-ui", "agent-manager", "AgentManagerApp.tsx"), "utf8")
const importer = readFileSync(join(root, "src", "agent-manager", "worktree-importer.ts"), "utf8")
const css = readFileSync(join(root, "webview-ui", "agent-manager", "agent-manager.css"), "utf8")
@@ -18,6 +19,10 @@ describe("Agent Manager New Worktree project targeting", () => {
expect(dialog).toContain('type: "agentManager.importFromBranch"')
})
it("does not replace a pending cross-project activation", () => {
expect(app).toContain("if (pendingCreate()) return")
})
it("tags branch and import responses with their owning project", () => {
expect(importer).toContain("async branches(projectId?: string)")
expect(importer).toContain('type: "agentManager.branches", projectId')
@@ -269,6 +269,7 @@ const AgentManagerContent: Component = () => {
const [pendingCreate, setPendingCreate] = createSignal<{ projectId: string }>()
const scheduleCreate = (projectId: string) => {
if (projectId === activeProjectId()) return
if (pendingCreate()) return
setPendingCreate({ projectId })
}
const isActivePayload = (pid: string | undefined) =>