Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(share): the reopen warning no longer points at a team tab or an unshare that does not give the project back

reviewc2c629c67bf0
diff --git a/docs/hosted-team-relay.md b/docs/hosted-team-relay.md
index c8edf8c03..ba2393bd6 100644
--- a/docs/hosted-team-relay.md
+++ b/docs/hosted-team-relay.md
@@ -349,11 +349,15 @@ host is a handover that started and did not finish, and the same guard applies.
Reopening the project from "Recently closed", with ⇧⌘T, or by opening the same host and folder as an
SSH project again, warns first:
-> <name> is now managed by team <team> on <host>. Open it from the team tab, or run "team unshare
-> <projectId>" on the server first.
+> <name> was handed to team <team> on <host>. The server keeps its canvas and keeps running its
+> agents, even after it is unshared. Opening it here gives one canvas two editors that can overwrite
+> each other, and its agents would start the same conversations the server is running.
>
-> Open it here anyway? Two copies editing one canvas can overwrite each other, and its agents would
-> start the same conversations the server is running. Its agents are not resumed here automatically.
+> Open it here anyway? Its agents are not resumed here automatically.
+
+The warning offers no other way out on purpose: `team unshare` only stops sharing the project, and
+the server keeps it and its running agents, so neither the team tab (gone once it is unshared) nor
+the command gives the project back to this desktop.
or, for a handover that did not finish:
diff --git a/src/renderer/lib/handedOff.test.ts b/src/renderer/lib/handedOff.test.ts
index 559c15523..5b0dbea05 100644
--- a/src/renderer/lib/handedOff.test.ts
+++ b/src/renderer/lib/handedOff.test.ts
@@ -4,13 +4,19 @@ import { handedOffWarning } from './handedOff'
const P = { name: 'proj', ssh: { server: { host: 'box', user: 'alice' }, remoteCwd: '~/proj' } } as never
describe('handedOffWarning', () => {
it('null for a project that was never handed off', () => expect(handedOffWarning(P, null)).toBeNull())
- it('names the team, the host and the unshare command', () => {
+ it('names the team and the host, and says the server keeps the project after an unshare', () => {
const w = handedOffWarning({ ...(P as object), handedOffTo: { hostId: 'H', projectId: 'project-9', at: 1 } } as never, 'Box team')
expect(w).toBe(
- 'proj is now managed by team Box team on box. Open it from the team tab, or run "team unshare project-9" on the server first.\n\n' +
- 'Open it here anyway? Two copies editing one canvas can overwrite each other, and its agents would start the same conversations the server is running. Its agents are not resumed here automatically.'
+ 'proj was handed to team Box team on box. The server keeps its canvas and keeps running its agents, even after it is unshared. ' +
+ 'Opening it here gives one canvas two editors that can overwrite each other, and its agents would start the same conversations the server is running.\n\n' +
+ 'Open it here anyway? Its agents are not resumed here automatically.'
)
})
+ it('points at no way out that does not exist after an unshare (no team tab, no unshare command)', () => {
+ const w = handedOffWarning({ ...(P as object), handedOffTo: { hostId: 'H', projectId: 'project-9', at: 1 } } as never, 'Box team')
+ expect(w).not.toMatch(/team tab/)
+ expect(w).not.toMatch(/team unshare/)
+ })
it('an unfinished handover says so', () => {
expect(handedOffWarning({ ...(P as object), handedOffTo: { at: 1 } } as never, null)).toMatch(/^Sharing proj with a team did not finish\./)
})
@@ -22,11 +28,12 @@ describe('handedOffWarning', () => {
})
it('an unknown or blank team label falls back to the generic name', () => {
const p = { ...(P as object), handedOffTo: { hostId: 'H', projectId: 'project-9', at: 1 } } as never
- expect(handedOffWarning(p, null)).toMatch(/^proj is now managed by team the hosted team on box\./)
- expect(handedOffWarning(p, ' ')).toMatch(/^proj is now managed by team the hosted team on box\./)
+ expect(handedOffWarning(p, null)).toMatch(/^proj was handed to team the hosted team on box\./)
+ expect(handedOffWarning(p, ' ')).toMatch(/^proj was handed to team the hosted team on box\./)
})
- it('a finished handover with no server project id still names the command, with its placeholder', () => {
- const w = handedOffWarning({ ...(P as object), handedOffTo: { hostId: 'H', at: 1 } } as never, 'Box team')
- expect(w).toContain('run "team unshare <projectId>" on the server first.')
+ it('a finished handover with no server project id reads the same', () => {
+ const withId = handedOffWarning({ ...(P as object), handedOffTo: { hostId: 'H', projectId: 'project-9', at: 1 } } as never, 'Box team')
+ const without = handedOffWarning({ ...(P as object), handedOffTo: { hostId: 'H', at: 1 } } as never, 'Box team')
+ expect(without).toBe(withId)
})
})
diff --git a/src/renderer/lib/handedOff.ts b/src/renderer/lib/handedOff.ts
index 70dcd5cbd..e8b659290 100644
--- a/src/renderer/lib/handedOff.ts
+++ b/src/renderer/lib/handedOff.ts
@@ -14,10 +14,13 @@ import type { Project } from '@shared/types'
* resuming them here too would put two processes on one transcript, and "Open here anyway" skips
* that automatic resume once.
*
+ * The finished copy names no way out ("open it from the team tab", "run team unshare first"),
+ * because neither gives the project back: after `team unshare` there is no team tab, and the
+ * server still holds the project and keeps its agents running (unshare only stops sharing it).
+ * So the copy says what is true in every state, shared or unshared.
+ *
* `teamLabel` is the team's name from this device's bookmark of it, when one is known; anything
- * else (no bookmark, a blank label) reads as "the hosted team". A finished mark always carries the
- * server's project id in practice; a hand-edited one without it still names the command, with the
- * same `<projectId>` placeholder the server's own usage text prints.
+ * else (no bookmark, a blank label) reads as "the hosted team".
*/
/** "Open here anyway" skips each agent's automatic resume once (terminal/handed-off-resume.ts). */
const AGENTS_NOT_RESUMED = 'Its agents are not resumed here automatically.'
@@ -38,12 +41,11 @@ export function handedOffWarning(
}
const team = teamLabel?.trim() || 'the hosted team'
const host = p.ssh?.server.host || 'its host'
- const projectId = to.projectId ?? '<projectId>'
return (
- `${p.name} is now managed by team ${team} on ${host}. Open it from the team tab, or run ` +
- `"team unshare ${projectId}" on the server first.\n\n` +
- 'Open it here anyway? Two copies editing one canvas can overwrite each other, and its agents ' +
- 'would start the same conversations the server is running. ' +
+ `${p.name} was handed to team ${team} on ${host}. The server keeps its canvas and keeps ` +
+ 'running its agents, even after it is unshared. Opening it here gives one canvas two editors ' +
+ 'that can overwrite each other, and its agents would start the same conversations the server ' +
+ 'is running.\n\nOpen it here anyway? ' +
AGENTS_NOT_RESUMED
)
}