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

read a single-line triple-quoted Codex base URL instead of reporting it blank (#6304)

[._.]/ Adam Eivy8d56902ec230
diff --git a/server/lib/codexUserConfig.js b/server/lib/codexUserConfig.js
index 4bc6f08f3a..6fedf6ff60 100644
--- a/server/lib/codexUserConfig.js
+++ b/server/lib/codexUserConfig.js
@@ -43,9 +43,17 @@ export const CODEX_ROUTING_KEYS = Object.freeze(['openai_base_url', 'model_provi
const KEY_ASSIGNMENT = /^\s*(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_.-]+))\s*=\s*(.*)$/;
const TABLE_HEADER = /^\s*\[/;
-/** Strip a TOML scalar's surrounding quotes; a non-string value returns null. */
+/**
+ * Strip a TOML scalar's surrounding quotes; a non-string value returns null.
+ *
+ * Triple quotes come FIRST, or a single-line `"""http://…"""` matches the
+ * empty basic string `""` and reports a base URL of `''` — present but blank,
+ * which is the "absent vs empty" collapse the repo's sentinel rule forbids.
+ */
const stringValue = (raw) => {
const trimmed = String(raw ?? '').trim();
+ const tripled = /^"""([\s\S]*)"""$|^'''([\s\S]*)'''$/.exec(trimmed);
+ if (tripled) return tripled[1] ?? tripled[2];
const quoted = /^"([^"]*)"|^'([^']*)'/.exec(trimmed);
return quoted ? (quoted[1] ?? quoted[2]) : null;
};
diff --git a/server/lib/codexUserConfig.test.js b/server/lib/codexUserConfig.test.js
index 0751e40d8d..ce2dab8a5a 100644
--- a/server/lib/codexUserConfig.test.js
+++ b/server/lib/codexUserConfig.test.js
@@ -74,6 +74,14 @@ describe('parseCodexRoutingOverride', () => {
.toEqual({ overridden: true, keys: ['openai_base_url'], baseUrl: null });
});
+ // A single-line triple-quoted value would otherwise match the empty basic
+ // string `""` and report a base URL of '' — present but blank, which is the
+ // absent-vs-empty collapse the sentinel rule forbids.
+ it('reads a single-line triple-quoted base URL rather than reporting a blank one', () => {
+ expect(parseCodexRoutingOverride('openai_base_url = """http://127.0.0.1:9999/v1"""'))
+ .toEqual({ overridden: true, keys: ['openai_base_url'], baseUrl: 'http://127.0.0.1:9999/v1' });
+ });
+
it('is empty for an empty file', () => {
expect(parseCodexRoutingOverride('')).toEqual({ overridden: false, keys: [], baseUrl: null });
});