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

address review (claude): pin the context-window constants, not just the table

[._.]/ Adam Eivy03f515338d62
diff --git a/scripts/migrations/206-claude-default-opus-5.js b/scripts/migrations/206-claude-default-opus-5.js
index 8857776835..c404796c99 100644
--- a/scripts/migrations/206-claude-default-opus-5.js
+++ b/scripts/migrations/206-claude-default-opus-5.js
@@ -88,7 +88,11 @@ const sameArray = (a, b) => {
const swapOpusPointers = (provider, opusMap) => {
let changed = false;
for (const key of POINTER_KEYS) {
- const mapped = opusMap[provider[key]];
+ // `Object.hasOwn` before the lookup: a bare `opusMap[provider[key]]` would
+ // inherit an Object.prototype member for a pointer literally named
+ // `constructor`/`toString`. Unreachable via the UI or any seed, but the
+ // guard costs nothing and keeps the map lookup honest.
+ const mapped = Object.hasOwn(opusMap, provider[key]) ? opusMap[provider[key]] : null;
if (mapped) {
provider[key] = mapped;
changed = true;
diff --git a/server/lib/stageRunner.mirror.test.js b/server/lib/stageRunner.mirror.test.js
index e5f40305a4..4d7a6f208f 100644
--- a/server/lib/stageRunner.mirror.test.js
+++ b/server/lib/stageRunner.mirror.test.js
@@ -28,7 +28,19 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
const SERVER_PATH = resolve(__dirname, 'stageRunner.js');
const CLIENT_PATH = resolve(__dirname, '../../client/src/utils/providers.js');
-const MIRRORED_NAMES = ['KNOWN_MODEL_CONTEXT_WINDOWS'];
+// The table's rows are `[/regex/i, SOME_CONTEXT_WINDOW]` — the *values* are
+// symbols defined separately in each file, so pinning the table text alone
+// leaves the exact hole this test exists to close: edit `CODEX_CONTEXT_WINDOW`
+// on one side only and the table still matches byte-for-byte while the two
+// ends silently disagree about the window. Pin the constants too.
+const MIRRORED_NAMES = [
+ 'DEFAULT_LARGE_CONTEXT_WINDOW',
+ 'CODEX_CONTEXT_WINDOW',
+ 'GEMINI_CONTEXT_WINDOW',
+ 'GROK_CONTEXT_WINDOW',
+ 'KIMI_CONTEXT_WINDOW',
+ 'KNOWN_MODEL_CONTEXT_WINDOWS',
+];
describe('stageRunner↔client providers context-window mirror parity', () => {
const serverSrc = readFileSync(SERVER_PATH, 'utf8');