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.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(project-limit): host-only prefix covers inbound requests only
review1c598d2cdcfd
diff --git a/src/shared/host-control.test.ts b/src/shared/host-control.test.tsindex 242cf7025..34869ddd5 100644--- a/src/shared/host-control.test.ts+++ b/src/shared/host-control.test.ts@@ -57,14 +57,16 @@ describe('isHostOnlyChannel', () => {expect(isHostOnlyChannel(IPC.stationNoticeList)).toBe(true)})- it('covers the whole project-limit namespace — a relay peer must never read or claim the host’s allowance', () => {+ it('a relay peer cannot invoke projectLimit:state / projectLimit:claim (inbound requests)', () => {// A claim spends the HOST's per-device allowance on the host's machine hash, and the state names- // the host's Pro and DNT facts. A relay tab keeps its own local preload for this namespace.+ // the host's Pro and DNT facts. This list only gates what a peer SENDS: the outbound+ // `projectLimit:changed` push is a separate rule (sent to this machine's windows only, never via+ // platform().broadcast), so it is deliberately not asserted here — a prefix match on it would+ // protect nothing.expect(isHostOnlyChannel(IPC.projectLimitState)).toBe(true)expect(isHostOnlyChannel(IPC.projectLimitClaim)).toBe(true)- expect(isHostOnlyChannel(IPC.projectLimitChanged)).toBe(true)expect(isHostOnlyChannel('projectLimit:claim')).toBe(true)- // A namespace, not a list: a verb added later is refused the day it is added.+ // A namespace, not a list: a request verb added later is refused the day it is added.expect(isHostOnlyChannel('projectLimit:something-new')).toBe(true)})diff --git a/src/shared/host-control.ts b/src/shared/host-control.tsindex 5b44229a8..6a0093d48 100644--- a/src/shared/host-control.ts+++ b/src/shared/host-control.ts@@ -51,10 +51,13 @@ export const HOST_ONLY_CHANNEL_PREFIXES: readonly string[] = [// credentials into the account dir, removal deletes one), and account usage read with the// host's stored tokens.'license:',- // The free-tier open-project allowance: a claim spends THIS device's allowance under this- // machine's hash, and the state reports the host's Pro and DO_NOT_TRACK facts. A relay tab keeps- // its own local preload for the namespace (relay-api.ts spreads `...local`), so only a peer- // sending the raw request would ever reach these.+ // The free-tier open-project allowance: refuses a relay peer's INBOUND `projectLimit:state` /+ // `projectLimit:claim` requests — a claim spends THIS device's allowance under this machine's hash,+ // and the state reports the host's Pro and DO_NOT_TRACK facts. A relay tab never sends them (it+ // keeps its local preload; relay-api.ts spreads `...local`). This list gates inbound req/cast ONLY:+ // the outbound `projectLimit:changed` push is kept off relay peers separately, by sending it to+ // this machine's own windows only (core/project-limit.ts), never through `platform().broadcast`,+ // which fans out to every relay peer.'projectLimit:','claude-accounts:','codex-accounts:',diff --git a/src/shared/ipc.ts b/src/shared/ipc.tsindex 088dffc61..214dc6244 100644--- a/src/shared/ipc.ts+++ b/src/shared/ipc.ts@@ -372,9 +372,10 @@ export const IPC = {licenseDetail: 'license:detail',licenseRelease: 'license:release',// Free-tier open-project limit (src/shared/project-limit.ts). renderer → main (invoke): the- // current `ProjectLimitState`, and a lazy allowance claim → `ClaimResult`. `projectLimitChanged`- // is main → renderer with the new state. Host-only (`projectLimit:` in HOST_ONLY_CHANNEL_PREFIXES):- // the allowance is this machine's, never a relay peer's to read or spend.+ // current `ProjectLimitState`, and a lazy allowance claim → `ClaimResult`; a relay peer's request+ // for either is refused (`projectLimit:` in HOST_ONLY_CHANNEL_PREFIXES). `projectLimitChanged` is+ // main → renderer with the new state, sent to this machine's windows only — never broadcast,+ // since a broadcast also reaches relay peers. The allowance is this machine's alone.projectLimitState: 'projectLimit:state',projectLimitClaim: 'projectLimit:claim',projectLimitChanged: 'projectLimit:changed',diff --git a/src/shared/types.ts b/src/shared/types.tsindex 23a1b5a85..82bcd657c 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -4188,7 +4188,8 @@ export interface ProjectLimitApi {/** Claim this device's allowance from the server (lazily, at the limit moment). Never rejects* for a network or server failure — that is `ok: false` with the state as it stands. */claim(): Promise<ClaimResult>- /** Fires with the new state whenever it changes. Returns unsubscribe. */+ /** Fires with the new state whenever it changes. Main sends it to this machine's windows only+ * (never broadcast to relay peers). Returns unsubscribe. */onChange(listener: (s: ProjectLimitState) => void): () => void}