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(window-raise): sign for standing-host's key-proof refusal dialog; fix host-token header

reviewf40440351205
diff --git a/src/core/relay/host-token.ts b/src/core/relay/host-token.ts
index ea53edb76..448e72e3e 100644
--- a/src/core/relay/host-token.ts
+++ b/src/core/relay/host-token.ts
@@ -7,14 +7,16 @@
// longer mint this host's tokens. Only a challenge answered 404/405 means "this backend predates the
// proof" and gets the legacy two-field mint; any other challenge failure is transient.
//
-// Unlike the desktop copy, which collapses every failure to `null`, this one says WHICH failure it
-// was, because the scheduler reacts differently to each: a 429 waits at least a minute, a 402/403
-// stops minting, anything else backs off and retries. One 403 is deliberately NOT terminal: a
-// `pop_required` answer to a mint sent WITHOUT a proof because the challenge said 404/405. A reverse
-// proxy answers 404 while the backend redeploys, and the unproven mint that follows can land on the
-// fresh backend, which requires a proof from a host it has seen prove before. Stopping there would
-// stop hosting for good over a redeploy, so it backs off and the next attempt asks for a challenge
-// again.
+// The desktop copy distinguishes only two outcomes: a terminal key-proof refusal (`{ refused }` —
+// `pop_invalid`, or `pop_required` on a proven mint), which stops phone access and tells the human
+// once, and `null` for every other failure, which backs off and retries. This one says WHICH failure
+// it was, because the scheduler reacts differently to each: a 429 waits at least a minute, a 402/403
+// stops minting, anything else backs off and retries. Both copies share one rule: a 403 is
+// deliberately NOT terminal when it is a `pop_required` answer to a mint sent WITHOUT a proof because
+// the challenge said 404/405. A reverse proxy answers 404 while the backend redeploys, and the
+// unproven mint that follows can land on the fresh backend, which requires a proof from a host it
+// has seen prove before. Stopping there would stop hosting for good over a redeploy, so it backs off
+// and the next attempt asks for a challenge again.
import { computePopProof, fetchPopChallenge, popRefusalOf, type PopRefusal } from './relay-pop'
export type MintResult =
diff --git a/src/main/window-raise.guard.test.ts b/src/main/window-raise.guard.test.ts
index 9467b8374..88293d3dc 100644
--- a/src/main/window-raise.guard.test.ts
+++ b/src/main/window-raise.guard.test.ts
@@ -86,14 +86,21 @@ const ALLOWED = new Map<string, { calls: number; why: string }>([
[
'remote/standing-host.ts',
{
- calls: 1,
+ calls: 2,
why:
'KNOWN GAP, reported not fixed: an app-modal dialog.showErrorBox raised from the relay ' +
'RECONNECT TIMER when the OS keyring is locked — no window parent, no user action. It is ' +
'a real instance of this rule and a different symptom from #737 (the user sees a dialog, ' +
'not a silent raise); the honest fix routes it to a non-modal in-app surface and needs a ' +
- 'macOS check that a sheet on a background window does not activate. Listed so it cannot ' +
- 'be forgotten, and so the count still fails if a SECOND one appears here'
+ 'macOS check that a sheet on a background window does not activate. The SECOND call is ' +
+ 'the same class: an app-modal showErrorBox (reportPopRefused) when the relay refuses this ' +
+ "host's key proof (pop_invalid, or pop_required on a proven mint), raised from a re-mint " +
+ 'on the refresh/reconnect timer. It is terminal and rare (a downgrade after the host ' +
+ 'latched, or a replaced key), and phone access silently stopping would be worse. Both ' +
+ "belong to one fix: route standing-host's dialogs to a non-modal in-app surface. The two " +
+ 'call sites stay separate on purpose (one shared helper would hide a raise from this ' +
+ 'count). Listed so they cannot be forgotten, and so the count still fails if a THIRD ' +
+ 'one appears here'
}
]
])