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.

test(renderer): pin that an approved mount never shows the waiting notice; drop a dead reset

reviewfeb753da2c4c
diff --git a/src/renderer/lib/hostedAttempts.ts b/src/renderer/lib/hostedAttempts.ts
index a08d10044..bfbc63219 100644
--- a/src/renderer/lib/hostedAttempts.ts
+++ b/src/renderer/lib/hostedAttempts.ts
@@ -196,10 +196,10 @@ export function createHostedAttempts(deps: HostedAttemptDeps): HostedAttempts {
e.drops += 1
return
}
+ // Live. This entry ends when this connection does (released, reported as `ended`); a later
+ // attempt for the team is a fresh entry, with a fresh ladder and a fresh drop budget.
const projectId = result.projectId
e.projectId = projectId
- e.attempt = 0
- e.drops = 0
if (e.closedEarly) {
endLive(e, e.closedEarly.reason)
return
diff --git a/src/renderer/lib/hostedJoin.test.ts b/src/renderer/lib/hostedJoin.test.ts
index 3cb554ccc..f36808efc 100644
--- a/src/renderer/lib/hostedJoin.test.ts
+++ b/src/renderer/lib/hostedJoin.test.ts
@@ -459,6 +459,19 @@ describe('hosted joiner', () => {
expect(h.approvedCbs.has('c0')).toBe(false) // unsubscribed once settled
})
+ it('R40: once approved, the waiting notice never appears — even while the tab is still loading', async () => {
+ const h = harness([{ hostId: 'H1', label: 'box', approved: true, code: codeFor('H1') }])
+ const j = createHostedJoiner(h.deps)
+ await j.bootReconnect()
+ h.connects[0].resolve('c0')
+ await flush()
+ h.approvedCbs.get('c0')!() // approved; the mount is still loading the workspace
+ const wait = h.timers.find((t) => t.ms === WAITING_NOTICE_DELAY_MS && !t.cleared)!
+ wait.cleared = true
+ wait.fn()
+ expect(h.notices).toEqual([])
+ })
+
it('R40: an approval that lands quickly never shows the waiting notice', async () => {
const h = harness([{ hostId: 'H1', label: 'box', approved: true, code: codeFor('H1') }])
const j = createHostedJoiner(h.deps)