Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Make the nightly Codex plugin door and pre-v0.18 upgrade fixture test what users get
garrytan8f687a1e7119
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cf2b584c82..e534e25e0f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,15 @@ credits are retained; no result has been reassigned to another provider. Originaidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased]++### The nightly Heavy Tests run checks the Codex plugin and old-brain upgrades again++**Two nightly checks had been failing on their own fixtures, not on gbrain. Both now test what users get.** The Codex plugin check expected gated tools to be listed even when their publish gate was off. The pre-v0.18 upgrade fixture couldn't build its legacy database because a newer trigger depends on the column it removes.++- `test/e2e/codex-plugin-install-real.serial.test.ts`: the expected tool list now resolves publish gates the way `gbrain serve` does for the seeded brain over stdio. Wakeshift's `watch_job`, `list_watches` and `unwatch` (#8670) and `set_memory_writeback` (#8481) are listed only when their gate is on. Before this change the check failed every night from 2026-11-06 on; it now passes against codex 0.147.0, the version the workflow pins.+- `tests/heavy/fixtures/down-mutate-pre-v0.18.sql`: before dropping `pages.source_id`, the fixture drops every trigger that depends on that column. The first such trigger was the per-folder access stamp from #8134. The walk forward re-creates those triggers. `tests/heavy/pg_upgrade_matrix.sh` failed on the pre-v0.18 shape before this change and passes on both shapes after it.+## [0.60.675.0] - 2026-11-11**Tool calls through native OpenAI models no longer fill every optional argument with a placeholder.** gbrain's tool loop (subagent jobs and SkillOpt rollouts) sends OpenAI models through the Responses API, and that API treats a tool definition with no `strict` field as strict: it marks every property required, so the model has to invent a value for each optional argument. A `get_page` call came back with a zero-line window and an empty byte range, which gbrain's own argument checks then refused. Native OpenAI tool definitions now say `strict: false`, so the schema's own `required` list holds and the model sends only the arguments it means. Anthropic, Google and the OpenAI-compatible providers (chat completions) send the same request as before. Reported and first fixed by @akinduroifedayo.diff --git a/test/e2e/codex-plugin-install-real.serial.test.ts b/test/e2e/codex-plugin-install-real.serial.test.tsindex e5ebd3d3bf..2d521fc6ea 100644--- a/test/e2e/codex-plugin-install-real.serial.test.ts+++ b/test/e2e/codex-plugin-install-real.serial.test.ts@@ -44,6 +44,9 @@ import {} from '../helpers/agent-harness.ts';import { operations } from '../../src/core/operations.ts';import { isCallable, publishGatesFromDisabled } from '../../src/core/ops/callable.ts';+import { disabledOpsForPublishGates } from '../../src/mcp/publish-gates.ts';+import { PGLiteEngine } from '../../src/core/pglite-engine.ts';+import { gbrainPath, loadConfig } from '../../src/core/config.ts';import { codexPluginProvidesName } from '../../src/core/bootstrap/harness.ts';const REPO_ROOT = resolve(import.meta.dir, '..', '..');@@ -51,6 +54,21 @@ const CLI = join(REPO_ROOT, 'src', 'cli.ts');const CODEX_BIN = resolveCodexBinary();const PLUGIN_CAPABLE = !!CODEX_BIN && codexSupportsPlugins(CODEX_BIN);+/** The ops whose publish gate resolves off on the seeded brain over stdio, read as `gbrain serve` reads them. */+async function seededGateDisabled(home: string): Promise<ReadonlySet<string>> {+ const savedHome = process.env.GBRAIN_HOME;+ process.env.GBRAIN_HOME = home;+ const engine = new PGLiteEngine();+ try {+ await engine.connect({ database_path: gbrainPath('brain.pglite'), engine: 'pglite' });+ return await disabledOpsForPublishGates(engine, loadConfig(), { transport: 'stdio' });+ } finally {+ await engine.disconnect();+ if (savedHome === undefined) delete process.env.GBRAIN_HOME;+ else process.env.GBRAIN_HOME = savedHome;+ }+}+/** Stage a CLEAN tree (tracked files only, modes preserved) from HEAD. */function stageCleanTree(): string {const stage = mkdtempSync(join(tmpdir(), 'gb-plugin-stage-'));@@ -218,7 +236,9 @@ describe.skipIf(!PLUGIN_CAPABLE)('codex plugin door — INSTALL (no auth needed)env: probeEnv,timeoutMs: 120_000,});- const publishGates = publishGatesFromDisabled(operations, new Set());+ // Publish gates resolve the way serve resolves them for this brain over stdio: a gated op (Wakeshift's watches,+ // the memory settings) is listed only when its gate is on, and the seeded brain turns on only publish_skills.+ const publishGates = publishGatesFromDisabled(operations, await seededGateDisabled(seededHome));const expected = operations.filter((o) => isCallable(o, { transport: 'stdio', surface: PLUGIN_SURFACE, scopes: [], publishGates })).map((o) => o.name).sort();expect(tools.sort()).toEqual(expected);diff --git a/tests/heavy/fixtures/down-mutate-pre-v0.18.sql b/tests/heavy/fixtures/down-mutate-pre-v0.18.sqlindex 063d60842b..4eb05c3d94 100644--- a/tests/heavy/fixtures/down-mutate-pre-v0.18.sql+++ b/tests/heavy/fixtures/down-mutate-pre-v0.18.sql@@ -30,6 +30,19 @@ BEGINEND LOOP;END $$;+-- Any other trigger that names pages.source_id (for example the per-folder access stamp, #8134) depends on the column too.+-- Pre-v0.18 brains had none of them; the walk forward re-creates each one when its migration runs again.+DO $$+DECLARE r record;+BEGIN+ FOR r IN SELECT DISTINCT t.tgname FROM pg_trigger t+ JOIN pg_depend d ON d.classid = 'pg_trigger'::regclass AND d.objid = t.oid+ JOIN pg_attribute a ON a.attrelid = d.refobjid AND a.attnum = d.refobjsubid+ WHERE d.refobjid = 'pages'::regclass AND a.attname = 'source_id' AND NOT t.tgisinternal LOOP+ EXECUTE format('DROP TRIGGER %I ON pages', r.tgname);+ END LOOP;+END $$;+DROP INDEX IF EXISTS idx_pages_source_id;ALTER TABLE pages DROP COLUMN IF EXISTS source_id;