Skip to content

Commit 7a6ba42

Browse files
committed
Clarify credential-model migration and clear credential cell in tests
1 parent 1d4beb8 commit 7a6ba42

6 files changed

Lines changed: 27 additions & 10 deletions

File tree

docs/VENDORING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ a ledger entry), and the second re-applies each `PATCHES.md` entry with an
108108
as-is / adapt / subsumed triage recorded in the ledgers. No entry was
109109
subsumed upstream. Upstream replaced inline provider `apiKey` plumbing
110110
with a `credentialId` + credential-cell model; no ledger entry touches
111-
auth and no first-party caller passes provider credentials into the
112-
vendored trees, so no migration was needed.
111+
auth so the vendored trees needed no migration, but first-party callers
112+
were migrated to the new model (each built source registers its secret
113+
in `src/config/source-credentials.ts`, handed to the vendored trees as
114+
their resolver).
113115

114116
`vendor/intx-workflow-host/workflow-definition-loader.ts` is new in this
115117
sync: a second partial-tree path alongside `adapters/`, carrying

src/config.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
SOURCE_MAX_TOKENS,
2424
} from "./config/index.js";
2525
import { DIRECTOR_IDS } from "./agent/directors/types.js";
26-
import { peekSourceCredentialSecret } from "./config/source-credentials.js";
26+
import { clearSourceCredentials, peekSourceCredentialSecret } from "./config/source-credentials.js";
2727
import type { Config, UnconfiguredConfig } from "./config/index.js";
2828
import {
2929
mergeProviderIntoSettings,
@@ -70,6 +70,7 @@ afterEach(() => {
7070
resetGoModelDiscoveryForTests();
7171
resetZenModelDiscoveryForTests();
7272
setProviderContextWindowOverrides(undefined);
73+
clearSourceCredentials();
7374
});
7475

7576
function assertConfigured(

src/config/inference-sources.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "../provider/context-window.js";
1414
import { createOpenAICompatibleAdapter } from "../provider/openai-compatible-adapter.js";
1515
import { createInferenceDependencies } from "../provider/inference-dependencies.js";
16+
import { clearSourceCredentials } from "./source-credentials.js";
1617
import { OPENAI_RESPONSES_PROVIDER } from "../provider/openai-responses.js";
1718
import { ZEN_MESSAGES_PROVIDER } from "../provider/zen-anthropic-adapter.js";
1819
import { firstClassProviderById } from "../../packages/first-class-providers/src/index.js";
@@ -81,6 +82,7 @@ function settingsWithWindow(): Settings {
8182
afterEach(() => {
8283
setProviderContextWindowOverrides(undefined);
8384
globalThis.fetch = originalFetch;
85+
clearSourceCredentials();
8486
});
8587

8688
describe("contextWindow / maxTokens split (CL-7784)", () => {

src/subagent/refresh-inference-source.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import * as codexSession from "../auth/codex/session.js";
33
import * as xaiSession from "../auth/xai/session.js";
44

55
import type { InferenceSource } from "@intx/types/runtime";
6-
import { peekSourceCredentialSecret } from "../config/source-credentials.js";
6+
import {
7+
clearSourceCredentials,
8+
peekSourceCredentialSecret,
9+
} from "../config/source-credentials.js";
710

811
const baseSource = (id: string): InferenceSource => ({
912
id,
@@ -15,6 +18,7 @@ const baseSource = (id: string): InferenceSource => ({
1518

1619
describe("refresh-inference-source", () => {
1720
afterEach(() => {
21+
clearSourceCredentials();
1822
spyOn(codexSession, "getValidCodexToken").mockRestore();
1923
spyOn(xaiSession, "getValidXaiToken").mockRestore();
2024
});

src/subagent/run-source.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import { describe, expect, test } from "bun:test";
1+
import { describe, expect, test, afterEach } from "bun:test";
22

3-
import { peekSourceCredentialSecret } from "../config/source-credentials.js";
3+
import {
4+
clearSourceCredentials,
5+
peekSourceCredentialSecret,
6+
} from "../config/source-credentials.js";
47
import { OPENCODE_GO_BASE_URL } from "../../packages/opencode-go/src/index.js";
58
import { buildSubAgentPrimarySource } from "./run.js";
69

10+
afterEach(() => {
11+
clearSourceCredentials();
12+
});
13+
714
describe("buildSubAgentPrimarySource", () => {
815
test("projects an Ollama root into the subagent OpenAI-compatible source", () => {
916
const bundle = buildSubAgentPrimarySource({

vendor/intx-inference/PATCHES.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ new upstream moved under the patch:
7878
`packages/inference/src/providers/google-genai.test.ts`; no ledger
7979
entry lived in either file, so nothing was triaged out with them.
8080
- Upstream replaced inline `apiKey` with a `credentialId` + credential-cell
81-
auth model. No entry touches auth, and first-party callers needed no
82-
migration: provider auth resolves inside the vendored trees
83-
(`createDefaultDependencies`), and no `src/` caller passes provider
84-
credentials into them.
81+
auth model. No entry touches auth, so the vendored trees needed no
82+
migration; first-party callers were migrated to the new model instead
83+
(each built source registers its secret in
84+
`src/config/source-credentials.ts`, handed to the vendored trees as
85+
their resolver).
8586

8687
## adapter-ts-stream-terminal-detector
8788

0 commit comments

Comments
 (0)