#7614 · Provider maintenance omits request-scoped executable configuration
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high · reproduction label: partial-repro
1. TL;DR
Provider model discovery has a request-scoped environment channel, but installation status and health do not. The real Claude bridge ignores a supplied request executable for those maintenance calls and instead reads its process environment. A controlled unavailable-fallback probe returns “not installed” even though a usable version-probe executable was supplied in the request; pointing the process environment at the same executable works. The host command validator also rejects contributed environment on both maintenance commands. This report verifies the backend discrepancy twice, but not the original clean macOS machine, third-party plugin, thread launch, or visible composer behavior.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Installation and health miss plugin-supplied executable configuration. | Verified at the maintenance boundary | The real bridge returns installed=false and health=not_installed with a request executable and unavailable process fallback. Both assertions fail in both checkouts; the process-environment control passes. |
| Host maintenance commands lack the contributed environment supported by model discovery. | Verified | Real schema validation accepts provider.list_models with contributedEnv, rejects provider.installation.status and provider.health with it, and accepts those two commands without it. |
| A third-party plugin works for explicit-model threads but blocks new-thread composition on a clean macOS host. | Unverified end to end | No external plugin, real provider session, browser, or macOS host was used. The backend failure is consistent with the symptom, not a screenshot-level reproduction. |
| Current model discovery already honors request env. | Verified statically | The model handler passes request.params.envVars into its model listing path; maintenance handlers do not. |
| Provider CLI status refreshes only after an installation/update. | Too broad | The status query is session-static, but provider-cli-status-changed also invalidates it. The server emits that event when a refreshed cached status changes. Config/plugin changes do not directly dirty this query in their registry entries. |
| An open page stays stale for a measured duration after an environment change. | Unverified | No browser timing experiment was performed. Cache policy and event routing were inspected only. |
3. Environment
Linux x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.12; source bb-app 0.49.0 and Plugin SDK 0.6.144. Both checkouts used the full trusted base commit above. No bb server, ports, runtime database, account, or real plugin was used. The executable is an agent-authored temporary Node script that emits a version string, not a copy of Claude Code.
Isolation caveat: this host has a global CLI in a toolchain fallback directory. Empty HOME/PATH alone did not hide it. The final probe instead sets the process-level override to a nonexistent temporary path, then supplies a valid executable via request env. Thus the original no-global-CLI machine is modeled with an unavailable fallback, not recreated literally. No real user configuration was changed.
Frozen installs succeeded. The first full build initially hit an unrelated SDK build-order race in the GitHub plugin; rerunning after the SDK runtime existed passed all 74 tasks. The second checkout built the SDK first and its full build passed all 74 tasks.
4. Minimal reproduction
- Obtain a fresh clone of the public repository, detach at the base commit, and install/build trusted source.
- Save the complete inline probe below as issue-7614.repro.test.ts in a local directory and set REPORT_DIR to that absolute directory.
- Copy the probe into the existing Claude provider package and run the focused Turbo task:
git clone https://github.com/get-bb/bb.git bb-7614-repro cd bb-7614-repro git checkout --detach da3e60b81d560e114a2bec724bb59c997aaaae7f pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build cp "$REPORT_DIR/issue-7614.repro.test.ts" plugins/provider-claude-code/src/bridge/issue-7614.repro.test.ts pnpm exec turbo run test --filter=bb-plugin-provider-claude-code --force -- src/bridge/issue-7614.repro.test.ts --silent=false
The expected contract is that request-scoped configuration identifies the supplied executable. For installation, installed should be true and executablePath should match the supplied temporary executable; health must not call it absent. On trusted main, the final probe exits 1 for precisely these two assertions:
installation response (selected fields):
"executablePath": null, "installed": false, "installSource": "notInstalled"
health response (selected fields):
"supported": true, "health": { "status": "not_installed" }
provider.list_models accepts contributedEnv: true
provider.installation.status accepts contributedEnv: false
provider.health accepts contributedEnv: false
Tests 2 failed | 2 passed (4)
The two passing controls prove the executable works when the process environment supplies it, and the transport distinction is real. No installer action returned in the status response is executed. The test restores all environment variables and removes its temporary fixture after each case. This probe is for Unix-like systems.
Complete probe
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { experimental_captureBridgeJsonRpcOutput as captureBridgeJsonRpcOutput } from "@get-bb/plugin-sdk/provider-bridge/testing";
import { hostDaemonOnlineRpcCommandSchema } from "../../../../packages/host-daemon-contract/src/commands.js";
import { handleLine } from "./bridge.js";
import { getClaudeProviderInstallationStatus } from "./provider-maintenance.js";
let homeDir: string;
let executablePath: string;
beforeEach(async () => {
homeDir = await mkdtemp(path.join(os.tmpdir(), "bb-7614-"));
const emptyPath = path.join(homeDir, "path");
executablePath = path.join(homeDir, "plugin", "claude");
await mkdir(emptyPath);
await mkdir(path.dirname(executablePath));
await writeFile(
executablePath,
`#!${process.execPath}\nprocess.stdout.write("2.1.310 (Claude Code)\\n");\n`,
{ mode: 0o755 },
);
vi.stubEnv("HOME", homeDir);
vi.stubEnv("PATH", emptyPath);
vi.stubEnv(
"BB_CLAUDE_CODE_EXECUTABLE",
path.join(homeDir, "absent", "claude"),
);
});
afterEach(async () => {
vi.unstubAllEnvs();
await rm(homeDir, { recursive: true, force: true });
});
it("control: the same executable is installed when present in process environment", async () => {
vi.stubEnv("BB_CLAUDE_CODE_EXECUTABLE", executablePath);
const status = await getClaudeProviderInstallationStatus(false);
expect(status).toMatchObject({
installed: true,
executablePath,
currentVersion: "2.1.310",
});
});
it("installation status recognizes a request-scoped executable", async () => {
const output = captureBridgeJsonRpcOutput();
try {
await handleLine(
JSON.stringify({
jsonrpc: "2.0",
id: 7614,
method: "provider/installation/status",
params: {
providerId: "claude-code",
checkUpdates: false,
envVars: { BB_CLAUDE_CODE_EXECUTABLE: executablePath },
},
}),
);
const messages = output.takeMessages();
await vi.waitFor(() => {
messages.push(...output.takeMessages());
expect(messages).toHaveLength(1);
});
console.info("installation response:", JSON.stringify(messages));
expect(messages).toEqual(
expect.arrayContaining([
expect.objectContaining({
id: 7614,
result: expect.objectContaining({ installed: true, executablePath }),
}),
]),
);
} finally {
output.restore();
}
});
it("health does not report a request-scoped executable as absent", async () => {
const output = captureBridgeJsonRpcOutput();
try {
await handleLine(
JSON.stringify({
jsonrpc: "2.0",
id: 7615,
method: "provider/health",
params: {
providerId: "claude-code",
envVars: { BB_CLAUDE_CODE_EXECUTABLE: executablePath },
},
}),
);
const messages = output.takeMessages();
await vi.waitFor(() => {
messages.push(...output.takeMessages());
expect(messages).toHaveLength(1);
});
console.info("health response:", JSON.stringify(messages));
expect(messages).not.toEqual(
expect.arrayContaining([
expect.objectContaining({
id: 7615,
result: expect.objectContaining({
health: expect.objectContaining({ status: "not_installed" }),
}),
}),
]),
);
} finally {
output.restore();
}
});
it("diagnostic: only the model command accepts contributed environment", () => {
const bridgeLaunch = {
pluginId: "provider-claude-code",
source: { kind: "artifact", digest: "a".repeat(64), byteLength: 1 },
capabilities: {
providerInstallation: true,
supportsServiceTier: false,
permissionModes: ["accept-edits"],
supportsThreadArchive: false,
supportsThreadRename: false,
fork: "none",
},
providerOptions: {},
envPassthrough: [],
};
const contributedEnv = [
{
name: "BB_CLAUDE_CODE_EXECUTABLE",
value: executablePath,
source: { plugin: "repro-fixture" },
reason: "isolated executable fixture",
},
];
for (const type of [
"provider.list_models",
"provider.installation.status",
"provider.health",
]) {
const baseCommand = { type, providerId: "claude-code", bridgeLaunch };
if (type !== "provider.list_models") {
expect(
hostDaemonOnlineRpcCommandSchema.safeParse(baseCommand).success,
).toBe(true);
}
const parsed = hostDaemonOnlineRpcCommandSchema.safeParse({
...baseCommand,
contributedEnv,
});
console.info(`${type} accepts contributedEnv: ${parsed.success}`);
expect(parsed.success).toBe(type === "provider.list_models");
}
});
5. Root cause
- The server assembles maintenance commands without resolving contributed provider environment: installation requests and health requests.
- The host command schemas require contributedEnv for models, but both maintenance schemas are strict and have no such field. Adding it to current maintenance commands fails validation.
- The daemon maintenance argument path and installation dispatch likewise carry no contributed environment.
- The real bridge handlers pass envVars to model discovery but call maintenance functions without request environment.
- claudeExecutable() reads only process.env.BB_CLAUDE_CODE_EXECUTABLE before default resolution. Both installation status and health use it.
async function claudeExecutable(): Promise<string> {
const explicit = process.env.BB_CLAUDE_CODE_EXECUTABLE?.trim();
if (explicit) return explicit;
return (await resolveExecutablePath("claude")) ?? "claude";
}
The UI’s host CLI status query uses session-static policy. However, realtime invalidation includes a dedicated provider-cli-status-changed event, and the server emits that event when cached status is replaced by a different value. It is inaccurate to describe this cache as refreshing only after install/update. Automatic environment-change invalidation still warrants a separate live regression.
6. Proposed fix and safety gate
Resolve provider contributions on the server with the target host context, carry explicit typed environment through maintenance commands and runtime requests, and have Claude maintenance resolve executable/configuration from that request rather than mutating shared process.env. Include environment fingerprints in affected caches, and invalidate host CLI status when relevant configuration changes. Preserve cross-host and concurrent-request isolation; test contributions changing while a bridge stays alive.
No autopilot pull request: an end-to-end repair must change the server/daemon wire contract and crosses server, daemon/runtime, bridge, and possibly UI cache owners. The rule forbids a simple fix that changes protocols or spans subsystems. No production patch or source branch was made. No linked open PR was found in the issue timeline or open-PR search for 7614 at review time.
7. Verification
The same agent created a second clean detached checkout at the exact base commit in /tmp/slopcop-7614/verify; its tracked worktree was clean after installation/build and before copying the probe. The first checkout was /tmp/slopcop-7614/base. The probe was copied byte-for-byte and the second Turbo test run used --force, so the result was not a cached replay. Each test allocated a fresh mkdtemp fixture and restored its environment.
pnpm exec turbo run test --filter=bb-plugin-provider-claude-code --force -- src/bridge/issue-7614.repro.test.ts --silent=false exit 1 Tests 2 failed | 2 passed (4)
Both checkouts returned the same missing installation and health results and the same schema outcomes. Verification correction: an initial empty-HOME/PATH experiment still discovered the machine-global fallback CLI; the final test explicitly isolates an unavailable fallback, and the verdict is PARTIALLY REPRODUCED rather than claiming the original clean-machine/UI scenario was recreated. This is a same-agent second run, not independent verification.
8. Related work
The current model-list handler demonstrates an existing request-env pattern. Related per-machine environment and Codex contribution reports concern neighboring paths, not proof that maintenance already works. No external plugin source, linked issue script, or PR branch was fetched or executed.
9. Appendix
Raw output and the reproduction test are retained locally, outside the published Git index. Public evidence is self-contained in this HTML. The following verbatim lines occur in both final test runs (the original console output includes the Turbo package prefix):
provider.list_models accepts contributedEnv: true provider.installation.status accepts contributedEnv: false provider.health accepts contributedEnv: false Tests 2 failed | 2 passed (4)
The serialized response excerpts above omit synthetic fixture paths and unused installer commands. They are not screenshots or a real-provider session. Both desired-behavior assertions fail, while the process-env control and command-schema diagnostic pass.
Investigation operations: fetched trusted origin/main; read issue properties/comments and linked-PR metadata; inspected the trusted files linked above; created two detached worktrees; installed frozen dependencies and built; ran the probe in each checkout. An attempted mount namespace was unavailable, so no namespace isolation is claimed. No live app process or listener was started.
Trust note: issue content was treated only as claims. No instructions, external URLs, patches, binaries, or tests supplied by issue data were executed. The probe was designed from trusted repository handlers and schemas.
> AGENT GENERATED