Skip to content

Commit 6424b08

Browse files
committed
fix: restore green contract and provider gates
1 parent dcd0cf9 commit 6424b08

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

extensions/matrix/src/setup-core.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ describe("matrixSetupAdapter", () => {
206206

207207
it("rejects unsupported avatar URL schemes during setup validation", () => {
208208
const validationError = matrixSetupAdapter.validateInput?.({
209+
cfg: {} as CoreConfig,
209210
accountId: "ops",
210211
input: {
211212
homeserver: "https://matrix.example.org",

src/agents/openai-tool-schema.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ type ToolWithParameters = {
1515
parameters: unknown;
1616
};
1717

18+
function optionalString(value: unknown): string | undefined {
19+
return typeof value === "string" ? value : undefined;
20+
}
21+
1822
export function normalizeStrictOpenAIJsonSchema(schema: unknown): unknown {
1923
return normalizeStrictOpenAIJsonSchemaRecursive(normalizeToolParameterSchema(schema ?? {}));
2024
}
@@ -131,12 +135,12 @@ export function resolvesToNativeOpenAIStrictTools(
131135
transport: OpenAITransportKind,
132136
): boolean {
133137
const capabilities = resolveProviderRequestCapabilities({
134-
provider: model.provider,
135-
api: model.api,
136-
baseUrl: model.baseUrl,
138+
provider: optionalString(model.provider),
139+
api: optionalString(model.api),
140+
baseUrl: optionalString(model.baseUrl),
137141
capability: "llm",
138142
transport,
139-
modelId: model.id,
143+
modelId: optionalString(model.id),
140144
compat:
141145
model.compat && typeof model.compat === "object"
142146
? (model.compat as { supportsStore?: boolean })

src/plugins/contracts/boundary-invariants.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const ALLOWED_EXTENSION_PATH_STRING_TESTS = new Set([
1717
"src/scripts/test-projects.test.ts",
1818
]);
1919

20+
const ALLOWED_CONTRACT_BUNDLED_PATH_HELPERS = new Set([
21+
"src/plugins/contracts/boundary-invariants.test.ts",
22+
"src/plugins/contracts/plugin-sdk-index.bundle.test.ts",
23+
"src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts",
24+
]);
25+
2026
describe("plugin contract boundary invariants", () => {
2127
it("keeps bundled-capability-metadata confined to contract/test inventory", async () => {
2228
const { globSync } = await import("glob");
@@ -67,4 +73,20 @@ describe("plugin contract boundary invariants", () => {
6773
});
6874
expect(offenders).toEqual([]);
6975
});
76+
77+
it("keeps plugin contract tests off bundled path helpers unless the test is explicitly about paths", async () => {
78+
const { globSync } = await import("glob");
79+
const files = globSync("src/plugins/contracts/**/*.test.ts", {
80+
cwd: REPO_ROOT,
81+
nodir: true,
82+
});
83+
const offenders = files.filter((file) => {
84+
if (ALLOWED_CONTRACT_BUNDLED_PATH_HELPERS.has(file)) {
85+
return false;
86+
}
87+
const source = readFileSync(resolve(REPO_ROOT, file), "utf8");
88+
return source.includes("test/helpers/bundled-plugin-paths");
89+
});
90+
expect(offenders).toEqual([]);
91+
});
7092
});

0 commit comments

Comments
 (0)