Skip to content

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

chore: release v1.54.0

[._.]/ Adam Eivyd2772e3e29ed
diff --git a/.changelog/NEXT.md b/.changelog/v1.54.0.md
similarity index 98%
rename from .changelog/NEXT.md
rename to .changelog/v1.54.0.md
index 21cfd3be2f..e65085c995 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/v1.54.0.md
@@ -1,6 +1,8 @@
-# Release vNEXT
+# Release v1.54.0
-Released: TBD
+Released: 2026-05-13
+
+**Full Diff**: https://github.com/atomantic/PortOS/compare/v1.53.0...v1.54.0
## Overview
diff --git a/PLAN.md b/PLAN.md
index f9f304b7f5..a157731846 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -8,6 +8,24 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]
- [ ] **Fix `lib/creativeDirectorPrompts.test.js` imageStrength wording assertions.** 3 tests in `server/lib/creativeDirectorPrompts.test.js` (around line 210) fail on `expect(out).toContain('Image strength: default')` — the prompt template no longer emits that exact phrasing for unset/null imageStrength. Pre-existing on `main` (verified 2026-05-12 while landing world-bible → pipeline wiring; out of scope for that PR). Either re-add the wording in the prompt builder or update the test to match the new output.
+### v1.54.0 release-review deferred items
+
+Captured 2026-05-13 during /do:release; rated below release-blocker but worth picking up:
+
+- [ ] **`WorldPromptRefineModal.jsx:182-185` — empty-list fallback restores deleted unlocked influences.** When a user has an unlocked embrace/avoid list and asks the LLM to clear it, the LLM returns `[]` but the client falls back to `originals.influences.*`, so the cleared list is silently restored. The diff modal shows the empty list to the user, so they can see it before applying — but Apply then ignores the diff. Drop the `.length ? a : b` guard for unlocked lists (locked path is already covered by server-side `mergeInfluencesWithLocksAdditive`). Add a regression test that sets `locked.influencesEmbrace = false`, LLM returns `embrace: []`, and asserts the patch carries `embrace: []`.
+- [ ] **Holistic refine deletion confirmation UX.** Refine can silently delete every unlocked variation/composite if the LLM omits them — by design (`drops unlocked items the LLM omits` test pins this), but the Apply button doesn't surface the deletion count. Add a "N items will be removed" callout in `StructureDiff` or an explicit confirm step in `WorldPromptRefineModal.handleApply`. `client/src/components/worldBuilder/WorldPromptRefineModal.jsx:187-189`.
+- [ ] **`mergeVariations` NPE guard in `WorldBuilder.jsx:435-445`.** `new Set(locked.map((v) => v.label.toLowerCase()))` assumes every locked variation has a string label. Mid-edit drafts could violate this. Match the `fresh` loop's `v.label?.toLowerCase()` guard and `.filter(Boolean)`.
+- [ ] **`server/routes/worldBuilder.js` lockedSchema strict-mode rejects legacy `influences` key.** `sanitizeLocked` migrates `locked.influences: true` → per-list locks on read, but the PATCH route's `lockedSchema.strict()` 400s if a stale client/script sends the legacy key. Either drop `.strict()` or whitelist `influences: z.boolean().optional()` so the migration story is symmetric. Single-user impact, but cleaner.
+- [ ] **Client tests for deep routing + drag.** No React Testing Library coverage for `/world-builder/:worldId` URL state, `@dnd-kit` chip reorder, or the localStorage-backed sidebar collapse. Add smoke tests for `goToWorld(id)` URL transitions and chip-reorder ordering (mock `useSortable`).
+- [ ] **`server/lib/aiToolkit/providers.js:200` — `testProvider` calls `execAsync(\`which ${provider.command}\`)` with user-controlled `command`.** Vendored from the published toolkit; PortOS is single-user/no-auth so this is "self-injection" only, but the field has no allowlist or escape. Switch to `execFile`/`spawn` with args array, or validate `provider.command` against `/^[A-Za-z0-9_-]+$/` before execAsync.
+- [ ] **`server/lib/aiToolkit/providers.js:25-31` — codex migration destructively drops extra `models[]` entries.** If `models` is `[sentinel, "gpt-5"]` (transitional/manual state), the migration overwrites the whole array with `[sentinel]`, silently losing extras. Either preserve non-sentinel entries or log a `console.warn` before overwrite.
+- [ ] **`server/lib/aiToolkit/routes/providers.js:47-60, 62-70` — POST/PUT skip Zod validation.** `providerSchema` exists in `validation.js` but is never applied; routes only do ad-hoc `name`/`type` checks. Per PortOS convention all route inputs should validate. Wire `validate(providerSchema, req.body)` or remove `validation.js` as dead code.
+- [ ] **`server/lib/aiToolkit/validation.js:3-17` — schema missing `fallbackProvider`, `lightModel`, `mediumModel`, `heavyModel`.** Schema doesn't match `createProvider()`'s field list. If validation is ever wired up, valid requests with these new fields will be stripped or rejected. Add them.
+- [ ] **`server/lib/aiToolkit/providers.js:124-143` — `createProvider` explicit field list vs. `updateProvider` spread asymmetry.** Future fields added to the UI but not to `createProvider`'s explicit list are silently dropped on creation but preserved on update. Add an end-to-end test that creates a provider with every field from `providers.sample.json` and asserts persistence, or switch `createProvider` to spread.
+- [ ] **`server/index.js:222-224` — providers warm-up is fire-and-forget.** Comment claims it "lands before any inbound request can race a concurrent write," but PortOS is single-process and the call is unawaited. Works incidentally because the awaited startup chain runs long, not by guarantee. Either `await aiToolkit.services.providers.getAllProviders()` before `httpServer.listen()`, or rewrite the comment to match reality ("pre-warm the providers cache and let the migration log fire before request logging starts").
+- [ ] **`server/lib/aiToolkit/providers.js:70-76` — corrupt `providers.json` crashes warm-up.** Truncated JSON throws from `JSON.parse` in `loadProviders`, and every subsequent request also throws. Wrap parse in try/catch; on failure rename the bad file to `.corrupt` and fall back to the sample.
+- [ ] **`server/lib/aiToolkit/runner.js:52-59` — `safeJsonParse` is not actually safe.** Function name suggests safety but contains an unguarded `JSON.parse`. Wrap in try/catch and return `fallback` on parse failure.
+
## Backlog
### Creative Director follow-ups
diff --git a/package-lock.json b/package-lock.json
index 804a880f72..9d2c10f109 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "portos",
- "version": "1.53.0",
+ "version": "1.54.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "portos",
- "version": "1.53.0",
+ "version": "1.54.0",
"license": "MIT",
"devDependencies": {
"pm2": "7.0.1"
diff --git a/package.json b/package.json
index bc972a60f9..1ce00c9cfc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "portos",
- "version": "1.53.0",
+ "version": "1.54.0",
"private": true,
"description": "Local dev machine App OS portal",
"author": "Adam Eivy (@antic|@atomantic)",
diff --git a/server/lib/aiToolkit/providers.test.js b/server/lib/aiToolkit/providers.test.js
index 40f08b0d91..d32a5098e5 100644
--- a/server/lib/aiToolkit/providers.test.js
+++ b/server/lib/aiToolkit/providers.test.js
@@ -188,4 +188,181 @@ describe('Provider Service', () => {
expect(existing).toBeUndefined();
});
});
+
+ describe('Codex provider auto-migration', () => {
+ const CODEX_SENTINEL = 'codex-configured-default';
+
+ const writeProvidersFile = async (data) => {
+ await writeFile(
+ join(TEST_DATA_DIR, 'providers.json'),
+ JSON.stringify(data, null, 2)
+ );
+ };
+
+ const readProvidersFile = async () => {
+ const { readFile } = await import('fs/promises');
+ const raw = await readFile(join(TEST_DATA_DIR, 'providers.json'), 'utf-8');
+ return JSON.parse(raw);
+ };
+
+ it('rewrites legacy codex models/defaultModel to the sentinel on first read', async () => {
+ await writeProvidersFile({
+ activeProvider: 'codex',
+ providers: {
+ codex: {
+ id: 'codex',
+ name: 'Codex CLI',
+ type: 'cli',
+ command: 'codex',
+ args: ['exec', '--full-auto'],
+ models: ['gpt-5.2', 'gpt-5-codex'],
+ defaultModel: 'gpt-5.2',
+ lightModel: 'gpt-5',
+ mediumModel: 'gpt-5.2',
+ heavyModel: 'gpt-5.2'
+ }
+ }
+ });
+
+ const codex = await providerService.getProviderById('codex');
+ expect(codex.models).toEqual([CODEX_SENTINEL]);
+ expect(codex.defaultModel).toBe(CODEX_SENTINEL);
+ expect(codex.lightModel).toBe(CODEX_SENTINEL);
+ expect(codex.mediumModel).toBe(CODEX_SENTINEL);
+ expect(codex.heavyModel).toBe(CODEX_SENTINEL);
+
+ const onDisk = await readProvidersFile();
+ expect(onDisk.providers.codex.defaultModel).toBe(CODEX_SENTINEL);
+ expect(onDisk.providers.codex.models).toEqual([CODEX_SENTINEL]);
+ });
+
+ it('is idempotent — already-migrated codex configs are not rewritten', async () => {
+ await writeProvidersFile({
+ activeProvider: 'codex',
+ providers: {
+ codex: {
+ id: 'codex',
+ name: 'Codex CLI',
+ type: 'cli',
+ command: 'codex',
+ args: ['exec'],
+ models: [CODEX_SENTINEL],
+ defaultModel: CODEX_SENTINEL,
+ lightModel: CODEX_SENTINEL,
+ mediumModel: CODEX_SENTINEL,
+ heavyModel: CODEX_SENTINEL
+ }
+ }
+ });
+
+ const { statSync } = await import('fs');
+ const path = join(TEST_DATA_DIR, 'providers.json');
+ const mtimeBefore = statSync(path).mtimeMs;
+
+ await new Promise((resolve) => setTimeout(resolve, 10));
+
+ await providerService.getProviderById('codex');
+ const mtimeAfter = statSync(path).mtimeMs;
+ expect(mtimeAfter).toBe(mtimeBefore);
+ });
+
+ it('does not touch non-codex providers', async () => {
+ await writeProvidersFile({
+ activeProvider: 'claude-code',
+ providers: {
+ 'claude-code': {
+ id: 'claude-code',
+ name: 'Claude Code',
+ type: 'cli',
+ command: 'claude',
+ models: ['claude-opus-4-7', 'claude-sonnet-4-6'],
+ defaultModel: 'claude-opus-4-7'
+ },
+ 'openai-api': {
+ id: 'openai-api',
+ name: 'OpenAI',
+ type: 'api',
+ apiKey: 'sk-test',
+ models: ['gpt-5.2', 'gpt-5'],
+ defaultModel: 'gpt-5.2'
+ }
+ }
+ });
+
+ const claude = await providerService.getProviderById('claude-code');
+ const openai = await providerService.getProviderById('openai-api');
+ expect(claude.defaultModel).toBe('claude-opus-4-7');
+ expect(claude.models).toEqual(['claude-opus-4-7', 'claude-sonnet-4-6']);
+ expect(openai.defaultModel).toBe('gpt-5.2');
+ expect(openai.models).toEqual(['gpt-5.2', 'gpt-5']);
+ });
+
+ it('does not touch a codex entry that is type:"api" (only type:"cli" matches)', async () => {
+ await writeProvidersFile({
+ activeProvider: 'codex',
+ providers: {
+ codex: {
+ id: 'codex',
+ name: 'Codex API',
+ type: 'api',
+ apiKey: 'sk-test',
+ models: ['gpt-5.2'],
+ defaultModel: 'gpt-5.2'
+ }
+ }
+ });
+
+ const codex = await providerService.getProviderById('codex');
+ expect(codex.defaultModel).toBe('gpt-5.2');
+ expect(codex.models).toEqual(['gpt-5.2']);
+ });
+
+ it('preserves other codex fields (command, args, enabled, envVars)', async () => {
+ await writeProvidersFile({
+ activeProvider: 'codex',
+ providers: {
+ codex: {
+ id: 'codex',
+ name: 'Codex CLI',
+ type: 'cli',
+ command: 'codex',
+ args: ['exec', '--full-auto', '--dangerously-bypass-approvals-and-sandbox'],
+ enabled: true,
+ envVars: { OPENAI_BASE_URL: 'https://example.com' },
+ models: ['gpt-5.2'],
+ defaultModel: 'gpt-5.2'
+ }
+ }
+ });
+
+ const codex = await providerService.getProviderById('codex');
+ expect(codex.command).toBe('codex');
+ expect(codex.args).toEqual([
+ 'exec',
+ '--full-auto',
+ '--dangerously-bypass-approvals-and-sandbox'
+ ]);
+ expect(codex.enabled).toBe(true);
+ expect(codex.envVars).toEqual({ OPENAI_BASE_URL: 'https://example.com' });
+ });
+
+ it('handles partial migration (only defaultModel pinned, models[] already sentinel)', async () => {
+ await writeProvidersFile({
+ activeProvider: 'codex',
+ providers: {
+ codex: {
+ id: 'codex',
+ type: 'cli',
+ command: 'codex',
+ models: [CODEX_SENTINEL],
+ defaultModel: 'gpt-5.2'
+ }
+ }
+ });
+
+ const codex = await providerService.getProviderById('codex');
+ expect(codex.models).toEqual([CODEX_SENTINEL]);
+ expect(codex.defaultModel).toBe(CODEX_SENTINEL);
+ });
+ });
});