add optional headers field to model config (#3546)

This commit is contained in:
Filip
2025-10-31 05:35:26 +01:00
committed by GitHub
parent 43e272e6c4
commit 51e4c9fc4c
5 changed files with 11 additions and 3 deletions

View File

@@ -270,13 +270,15 @@ export namespace SessionPrompt {
toolName: "invalid",
}
},
headers:
model.providerID === "opencode"
headers: {
...(model.providerID === "opencode"
? {
"x-opencode-session": input.sessionID,
"x-opencode-request": userMsg.info.id,
}
: undefined,
: undefined),
...model.info.headers,
},
// set to 0, we handle loop
maxRetries: 0,
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
@@ -1816,6 +1818,7 @@ export namespace SessionPrompt {
},
]),
],
headers: small.info.headers,
model: small.language,
})
.then((result) => {