Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
test([issue-3618]): walk the shipped provider catalog through both TUI dispatch points
[._.]/ Adam Eivy44678eb40979
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex a9d52ab698..0fbb461039 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -16,6 +16,9 @@- **Stacker News triage is newest-first and action-oriented.** Each community sync is capped to a configurable newest-item count (30 by default), preserves source timestamps for stable ordering, captures direct image posts for Ollama vision analysis, and gives every newest item explicit reply, zap-handoff, moderation-handoff, and analysis actions behind the existing human review gate.- **The claim-issue author gate has a "Me + collaborators" setting.** Until now the only way to let an agent work on a teammate's issue was "Any author", which also opens the queue to drive-by issues from strangers — so a repo with any real collaborators had to choose between ignoring their issues and claiming everyone's. The new option trusts you plus every account the forge already grants access to (GitHub collaborators, GitLab project members including group-inherited ones), which is the same set that could push the code anyway. It sits between "Filed by me only" (still the default) and "Any author" in the CoS → Schedule author-filter dropdown, in the per-app override, and in the `/do:next` run drawer, and applies to `claim-issue` and `claim-work` alike. Neither CLI's `--author` flag accepts more than one account, so the gate is applied to the issue listing rather than pushed into the query — both the work detector and the agent prompt resolve the trusted set first, then filter. If that lookup fails (a token without push access can't read the collaborator list), PortOS reports it and retries rather than quietly narrowing back to your own issues or widening to everybody — and because that failure repeats identically on every retry, both the run drawer and the "Run now" toast name the filter and the way out instead of the generic "try again shortly".+## Changed+- **[issue-3618] A newly added coding-agent provider can no longer silently miss one of the steps that launch its interactive session.** Adding a vendor means teaching several independent launch steps about it, and forgetting one is invisible from the outside: the provider appears in the picker and spawns, then either runs the wrong binary or comes up without the flags that let it work unattended and stalls on its first approval prompt with nobody there to answer. A test now walks every provider in the shipped catalog through those steps, so a vendor any of them doesn't recognize fails in CI instead of in a dead agent session. No shipped provider's behavior changed.+## Documentation- **Updated documentation index and feature references.** Added missing feature deep dive links for Quota-burn automation (`QUOTA-BURN.md`), Three.js procedural 3D models (`THREEJS_MODELS.md`), Stacker News stewardship (`stacker-news.md`), and the PortDeck native companion app API contract (`COMPANION_APP_API.md`) across `README.md` and `docs/README.md`. Improved inline JSDoc comments for client and server utility modules.diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.jsindex 6cc2c32f8b..a7f429d8f2 100644--- a/server/lib/tuiHandshake.test.js+++ b/server/lib/tuiHandshake.test.js@@ -50,6 +50,9 @@ import {AGY_INPUT_READY_PATTERN,} from './tuiHandshake.js';import { CODEX_CONFIGURED_DEFAULT } from './providerModels.js';+import { readFileSync } from 'fs';+import { dirname, resolve } from 'path';+import { fileURLToPath } from 'url';// The exported constants are load-bearing for both production callers// (`tuiPromptRunner.js`, `agentTuiSpawning.js`). Pin every value so an@@ -1169,3 +1172,120 @@ describe('tuiHandshake.isCollapsedPasteChip', () => {expect(isCollapsedPasteChip(123)).toBe(false);});});++// ─── Discovery: shipped-catalog parity for the TUI dispatch points ─────────+//+// Adding a coding-agent vendor means touching a spread of per-vendor `if`+// branches, and the failure mode is SILENT: the vendor ships in the seed+// catalog, its provider shows up in the UI and spawns, but a dispatch point+// nobody remembered doesn't know it — so it launches with the wrong binary or+// without its unattended-run posture and stalls on a prompt with nobody to+// answer. (Not theoretical: `resolveInjectedTuiModel` exists because the two+// model-injection sites had already drifted that way — issue #3618.)+//+// These tests DERIVE their expectations by walking `data.reference/providers.json`+// rather than hand-transcribing a vendor list, so a newly-seeded vendor that a+// builder doesn't know about FAILS here instead of diverging in production.+// Same shape as `server/cos-runner/allowedCommands.test.js` (catalog-derived+// parity) and `server/lib/cliChildEnv.test.js` (discovery of a hand-rolled+// call site). Sibling coverage for the model-injection point lives in+// `providerModels.test.js#resolveInjectedTuiModel`.+describe('tuiHandshake — parity with the shipped provider catalog', () => {+ const SEED_PATH = resolve(dirname(fileURLToPath(import.meta.url)), '../../data.reference/providers.json');+ const seedProviders = Object.entries(+ JSON.parse(readFileSync(SEED_PATH, 'utf8')).providers || {}+ )+ .map(([id, p]) => ({ ...p, id }))+ .filter((p) => typeof p.command === 'string' && p.command);+ const tuiProviders = seedProviders.filter((p) => p.type === 'tui');+ const tuiCommands = [...new Set(tuiProviders.map((p) => p.command))];++ // Commands `applyCommandDefaults` deliberately has NO arm for, and where the+ // unattended-run posture actually comes from. Both are asserted below, so an+ // exemption can't rot into "we just forgot this vendor":+ // - the builder must still inject nothing for it, and+ // - the recorded alternate channel must still carry the posture in the seed.+ // A vendor absent from BOTH this map and `applyCommandDefaults` fails.+ const POSTURE_NOT_FROM_BUILDER = new Map([+ // claude's `--dangerously-skip-permissions` rides in the seed `args`.+ ['claude', { channel: 'args', marker: '--dangerously-skip-permissions' }],+ // opencode has no argv approval/trust gate; its permission posture is+ // configured through OPENCODE_CONFIG_CONTENT (see cliChildEnv.js).+ ['opencode', { channel: 'envVars', marker: '"permission":"allow"' }],+ ]);++ it('parses the shipped catalog (guards against a silently empty walk)', () => {+ expect(seedProviders.length).toBeGreaterThan(0);+ expect(tuiProviders.length).toBeGreaterThan(0);+ // More than one distinct binary, or the per-command loops below prove nothing.+ expect(tuiCommands.length).toBeGreaterThan(1);+ });++ // `inferTuiCommand` is the blank-`provider.command` fallback for BOTH spawners+ // and the binary `resolveSlashdoStyle` asks about before deciding whether a+ // session can type `/do:pr`. A vendor missing from its map silently resolves+ // to `claude` — the wrong binary, told to run slash commands it doesn't have.+ it.each(seedProviders.map((p) => [p.id, p.command]))(+ 'inferTuiCommand("%s") resolves to the catalog command "%s"',+ (id, command) => {+ expect(inferTuiCommand(id)).toBe(command);+ }+ );++ // `applyCommandDefaults` is the TUI approval/trust-argv dispatch. A vendor+ // with no arm falls through `return args` unchanged and launches interactive,+ // then stalls on its first tool-approval prompt with nobody at the keyboard.+ describe.each(tuiCommands)('applyCommandDefaults("%s")', (command) => {+ const exemption = POSTURE_NOT_FROM_BUILDER.get(command);++ if (exemption) {+ it('injects nothing (its posture comes from another channel)', () => {+ expect(applyCommandDefaults(command, [])).toEqual([]);+ });++ it(`still gets its unattended posture from the seed ${exemption.channel}`, () => {+ for (const provider of tuiProviders.filter((p) => p.command === command)) {+ const declared = exemption.channel === 'args'+ ? (provider.args || []).join(' ')+ // The env VALUES verbatim — not JSON.stringify of the map, which+ // would re-escape the quotes inside OPENCODE_CONFIG_CONTENT's own+ // embedded JSON and never match the marker.+ : Object.values(provider.envVars || {}).join(' ');+ expect(declared, `${provider.id} must declare ${exemption.marker}`)+ .toContain(exemption.marker);+ }+ });+ } else {+ it('has a dispatch arm that injects an unattended-run posture', () => {+ expect(+ applyCommandDefaults(command, []),+ `No applyCommandDefaults arm for "${command}". Add one (see ensureCursorTuiArgs), `+ + 'or record why its posture arrives another way in POSTURE_NOT_FROM_BUILDER.'+ ).not.toEqual([]);+ });+ }+ });++ // Each spawn path calls applyCommandDefaults on argv that may ALREADY carry+ // the seed's posture flags, so a non-idempotent arm double-appends — codex+ // errors outright on a repeated approval flag, and every other vendor grows a+ // duplicated argv that's a coin flip on which wins.+ it.each(tuiProviders.map((p) => [p.id, p.command, p.args || []]))(+ 'applyCommandDefaults is idempotent over the seed args of "%s" (%s)',+ (_id, command, args) => {+ const once = applyCommandDefaults(command, [...args]);+ expect(applyCommandDefaults(command, [...once])).toEqual(once);+ }+ );++ // End-to-end over the two dispatch points at once: a provider whose `command`+ // is blank (older stored configs, and the shape `buildTuiSpawnConfig` handles)+ // must land on exactly the same invocation as the fully-specified one.+ it.each(tuiProviders.map((p) => [p.id, p]))(+ 'buildTuiInvocation("%s") is identical with and without an explicit command',+ (_id, provider) => {+ expect(buildTuiInvocation({ ...provider, command: '' }))+ .toEqual(buildTuiInvocation(provider));+ }+ );+});