Skip to content

Commit 4b9afee

Browse files
fix: resolve CI failures (cohere TS2722 + surface report budget)
1 parent 1c33b01 commit 4b9afee

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

extensions/cohere/index.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ function captureCoherePayload(context: Context): Record<string, unknown> {
3636
};
3737

3838
const wrappedStreamFn = createCohereCompletionsWrapper(baseStreamFn);
39-
if (!wrappedStreamFn) {
40-
throw new Error("Cohere wrapper did not return a stream function");
41-
}
4239
void wrappedStreamFn(requireCohereModel(), context, {
4340
onPayload: (payload) => {
4441
captured = payload as Record<string, unknown>;

extensions/cohere/stream.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
1+
import type { StreamFn } from "openclaw/plugin-sdk/agent-core";
22
import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
33

44
function patchCoherePayload(payload: Record<string, unknown>): void {
5-
// Cohere's Compatibility API uses developer, not system, for instructions.
65
if (Array.isArray(payload.messages)) {
76
payload.messages = payload.messages.map((message) =>
87
message &&
@@ -13,13 +12,10 @@ function patchCoherePayload(payload: Record<string, unknown>): void {
1312
);
1413
}
1514

16-
// Cohere lets tool-capable models choose a tool when tool_choice is omitted.
1715
delete payload.tool_choice;
1816
}
1917

20-
export function createCohereCompletionsWrapper(
21-
baseStreamFn: ProviderWrapStreamFnContext["streamFn"],
22-
): ProviderWrapStreamFnContext["streamFn"] {
18+
export function createCohereCompletionsWrapper(baseStreamFn: StreamFn | undefined): StreamFn {
2319
return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload }) =>
2420
patchCoherePayload(payload),
2521
);

scripts/plugin-sdk-surface-report.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ try {
162162
budgets = {
163163
publicEntrypoints: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_ENTRYPOINTS", 319),
164164
publicExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS", 10291),
165-
publicFunctionExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS", 5166),
165+
publicFunctionExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS", 5168),
166166
publicDeprecatedExports: readBudgetEnv(
167167
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS",
168168
3244,

0 commit comments

Comments
 (0)