Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: doctor goldens and harness fixtures read the launcher-era harness_wiring
garrytanff326e50e4d9
diff --git a/test/agent-journey-upgrade.serial.test.ts b/test/agent-journey-upgrade.serial.test.tsindex 9a02895d01..3bd3e70d48 100644--- a/test/agent-journey-upgrade.serial.test.ts+++ b/test/agent-journey-upgrade.serial.test.ts@@ -286,7 +286,8 @@ describe('(3) harness configs registered before the upgrade', () => {const fixed = await run(h, ['setup', harness, '--instructions-only', '--json']);expect(fixed.exitCode, fixed.stderr).toBe(0);const after = harnessCheck(await run(h, ['doctor', '--only', 'harness_wiring', '--json']));- expect(after, JSON.stringify(after)).toMatchObject({ status: 'ok', details: { harness, reason: 'wired_running', smoke: 'smoke_passed', instructions: expect.arrayContaining([expect.objectContaining({ harness, state: 'current' })]) } });+ // The block is fixed; a registration written before the launcher (#8426) still starts serve in the session's directory, so doctor hands it to the user.+ expect(after, JSON.stringify(after)).toMatchObject({ status: 'warn', details: { harness, reason: 'wired_running', smoke: 'smoke_passed', code: 'hook_session_cwd', hook_launcher: { harness, lane: 'mcp', reason: 'session_cwd', owner: 'none' }, instructions: expect.arrayContaining([expect.objectContaining({ harness, state: 'current' })]) }, fix: { actor: 'user' } });}test('a pre-surface Claude Code registration (`serve`, no --surface) keeps the full catalog and recalls', async () => {diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex be04858b95..52914748c1 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -47,7 +47,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -448,7 +448,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-connection-failure.json b/test/fixtures/goldens/doctor/early-stop-connection-failure.jsonindex b6b9c681e0..fc1f4b17a5 100644--- a/test/fixtures/goldens/doctor/early-stop-connection-failure.json+++ b/test/fixtures/goldens/doctor/early-stop-connection-failure.json@@ -323,7 +323,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.jsonindex fad1e2a353..12344e17cc 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-connect-error.json@@ -232,7 +232,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.jsonindex 0b60d71931..5a02a86f99 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-fast.json@@ -232,7 +232,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.jsonindex b04ea205e6..6d94dd2632 100644--- a/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json+++ b/test/fixtures/goldens/doctor/early-stop-null-engine-no-config.json@@ -226,7 +226,7 @@"docs": "docs/protocol/MEMORY_VERBS_v1.md#install-the-4-command-quickstart","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex 049011c293..12201d2942 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -48,7 +48,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -449,7 +449,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",@@ -5012,7 +5012,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -5413,7 +5413,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.jsonindex 5b0d88b9d1..65e4b7e83a 100644--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json@@ -443,7 +443,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",@@ -5408,7 +5408,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex b7fc4836ec..3885dd16cd 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -44,7 +44,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -430,7 +430,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-fast.json b/test/fixtures/goldens/doctor/json-pglite-fast.jsonindex 2d4d7c3687..ff036783e4 100644--- a/test/fixtures/goldens/doctor/json-pglite-fast.json+++ b/test/fixtures/goldens/doctor/json-pglite-fast.json@@ -45,7 +45,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -320,7 +320,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 5468d249ca..a4c0ccefa0 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -47,7 +47,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "pglite — serve IPC socket not present; enabled but NO resolve path exists right now: the IPC socket is only bound by a running `gbrain serve` (stdio or --http) — until one is up, hooks/reflex degrade to no_serve on this brain (host capability may still supply pointers; policy skill carries otherwise) — policy skill not installed; run `gbrain integrations install retrieval-reflex --target <host-repo>`","name": "retrieval_reflex_health",@@ -433,7 +433,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex e47cc937ef..143798ccae 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -427,7 +427,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.jsonindex 4e36926db1..451eecd02e 100644--- a/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable-fast.json@@ -272,7 +272,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/fixtures/goldens/doctor/json-postgres-unreachable.json b/test/fixtures/goldens/doctor/json-postgres-unreachable.jsonindex 02fba1aea0..b4710ccb80 100644--- a/test/fixtures/goldens/doctor/json-postgres-unreachable.json+++ b/test/fixtures/goldens/doctor/json-postgres-unreachable.json@@ -271,7 +271,7 @@"next": "report","requires_exclusive": false,"user_message": "Which agent app should get gbrain memory? The install guide has a one-line command for each.",- "why": "Register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."+ "why": "For Claude Code or Codex, run `gbrain setup claude-code` or `gbrain setup codex` (it registers serve behind gbrain's launcher, so the session directory's bunfig.toml and .env never load). For any other host, register `<absolute path to gbrain> serve --surface starter --advertise verbs` as a stdio MCP server in your agent host; the install section lists the exact command per harness (Claude Code, Codex, Grok Build, opencode, OpenClaw)."},"message": "No agent harness was detected. Wire one when the user picks an agent app.","name": "harness_wiring",diff --git a/test/setup-brain-first.test.ts b/test/setup-brain-first.test.tsindex bcd76d6c2d..8c0a4e71c6 100644--- a/test/setup-brain-first.test.ts+++ b/test/setup-brain-first.test.ts@@ -27,6 +27,7 @@ import {} from '../src/core/setup/brain-first.ts';import { harnessWiringCheck, instructionBlockViews, withInstructionBlocks, withSurfaceNote, type InstructionBlockView } from '../src/commands/doctor/checks/harness-wiring.ts';import { installHarnessConnection } from '../src/core/harness/install.ts';+import { ensureHookLauncher, hookLauncherPath } from '../src/core/setup/hook-launcher.ts';import type { HarnessCredentials } from '../src/core/harness/credentials.ts';const CLI = resolve(import.meta.dir, '..', 'src', 'cli.ts');@@ -499,8 +500,10 @@ describe('brain-first block: full setup and the installer lanes', () => {});describe('doctor harness_wiring reports the block', () => {+ /** A current stdio registration: serve behind gbrain's hook launcher, the shape setup writes (#8426). */function stdioRegistration(b: Box): void {- writeFileSync(join(b.home, '.claude.json'), JSON.stringify({ mcpServers: { gbrain: { type: 'stdio', command: b.bin, args: ['serve'] } } }));+ const launcher = ensureHookLauncher(hookLauncherPath(join(b.home, '.gbrain')));+ writeFileSync(join(b.home, '.claude.json'), JSON.stringify({ mcpServers: { gbrain: { type: 'stdio', command: launcher, args: [b.bin, 'serve'] } } }));}const env = (b: Box) => ({ ...b.env, CLAUDECODE: undefined, CLAUDE_CODE_ENTRYPOINT: undefined, CODEX_SANDBOX: undefined, CODEX_CI: undefined, OPENCODE: undefined, OPENCODE_PID: undefined });