From f7a9c5c040f2cfbd7286ca381a6508616d1ddcdc Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:34:06 -0700 Subject: [PATCH] fix(agent): don't pass a land check's base to launched agents #304 gives land checks QUEST_LAND_BASE, and quest agent forwarded it, so every quest batch failed its own agent tests. Like QUEST_GATE_ADMITTED, it describes the caller's gate, not the agent's work. Co-Authored-By: Claude Opus 5.5 --- src/cli/agent.ts | 5 +++-- test/agent.test.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/agent.ts b/src/cli/agent.ts index e83af69a..8f833bfa 100644 --- a/src/cli/agent.ts +++ b/src/cli/agent.ts @@ -206,8 +206,8 @@ export class AgentInputError extends Error {} * state and credentials, other keys, and secret-manager tokens. Without them * the agent neither reuses the session's account nor acts as its sub-session. * A launch from inside a `quest gate` command does not admit the agent's own - * expensive commands, so the gate's mark is dropped too. Each CLI keeps the - * user's configuration directory. + * expensive commands, so the gate's mark is dropped too, as is the base a land + * check runs against. Each CLI keeps the user's configuration directory. */ const STRIPPED = [ /^CLAUDE(?!_CONFIG_DIR$)/, @@ -217,6 +217,7 @@ const STRIPPED = [ /^OP_/, /^QUEST_API_KEYS$/, /^QUEST_GATE_ADMITTED$/, + /^QUEST_LAND_BASE$/, ]; /** The agent's environment: the user's, minus `STRIPPED`, plus its one key. */ diff --git a/test/agent.test.ts b/test/agent.test.ts index da75f50d..0296fd1e 100644 --- a/test/agent.test.ts +++ b/test/agent.test.ts @@ -248,6 +248,7 @@ test("the agent environment holds only its own key", () => { ANTHROPIC_BASE_URL: "https://proxy", QUEST_API_KEYS: "a b", QUEST_GATE_ADMITTED: "1", + QUEST_LAND_BASE: "0123456789abcdef0123456789abcdef01234567", OP_SERVICE_ACCOUNT_TOKEN: "t", OP_SESSION_me: "s", OPENAI_API_KEY: "o",