Skip to content

Commit c5aa9a8

Browse files
authored
fix: stop declaring max output tokens (#1479)
1 parent d45afac commit c5aa9a8

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/agent/runner/harness/pi/gateway.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export function buildGatewayModel(inputs: GatewayProviderInputs) {
9797
// UnsupportedParamsError → the run no-ops).
9898
reasoning: modelCapabilities(modelId).reasoning,
9999
// The gateway refuses `developer` messages on pinned tokens, so pi sends `system`.
100-
compat: { supportsDeveloperRole: false },
100+
// It also sizes a scoped token's hold from max_output_tokens, so omit it, as pi 0.79 did.
101+
compat: { supportsDeveloperRole: false, supportsMaxOutputTokens: false },
101102
input: ['text' as const],
102103
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
103104
contextWindow: 1_000_000,

‎src/agent/triage-provider.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@ export function createTriageLLMProvider(
5858
const { completeSimple } = await import('@earendil-works/pi-ai/compat');
5959
const current = await resolveAuth();
6060
const authToken = current.authToken;
61-
const model = buildGatewayModel({
61+
const gatewayModel = buildGatewayModel({
6262
gatewayUrl: current.baseURL,
6363
accessToken: authToken,
6464
teamId: current.teamId,
6565
wizardMetadata: current.wizardMetadata ?? {},
6666
wizardFlags: current.wizardFlags ?? {},
6767
modelId,
6868
});
69+
// Triage sets its own small cap, so keep sending it on the OpenAI path.
70+
const model = {
71+
...gatewayModel,
72+
compat: { ...gatewayModel.compat, supportsMaxOutputTokens: true },
73+
};
6974
const controller = new AbortController();
7075
const timer = setTimeout(() => controller.abort(), TRIAGE_TIMEOUT_MS);
7176
try {

0 commit comments

Comments
 (0)