diff options
| author | Armin Pašalić <[email protected]> | 2026-03-09 15:22:00 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-09 09:22:00 -0500 |
| commit | ef9bc4ec9ee5101b7f6e584a80600136007ac7a7 (patch) | |
| tree | c4122b6796d2822253378ef25cac568ff0bcf175 /packages | |
| parent | 5838b58913ec5e6c694c2f8f9df8009f49bf4018 (diff) | |
| download | opencode-ef9bc4ec9ee5101b7f6e584a80600136007ac7a7.tar.gz opencode-ef9bc4ec9ee5101b7f6e584a80600136007ac7a7.zip | |
feat(gitlab): send context-1m-2025-08-07 beta header to enable 1M context window (#16153)
Co-authored-by: Aiden Cline <[email protected]>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/provider/provider.ts | 1 | ||||
| -rw-r--r-- | packages/opencode/test/provider/gitlab-duo.test.ts | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts index 6d5c9d1ad..09035d272 100644 --- a/packages/opencode/src/provider/provider.ts +++ b/packages/opencode/src/provider/provider.ts @@ -480,6 +480,7 @@ export namespace Provider { const aiGatewayHeaders = { "User-Agent": `opencode/${Installation.VERSION} gitlab-ai-provider/${GITLAB_PROVIDER_VERSION} (${os.platform()} ${os.release()}; ${os.arch()})`, + "anthropic-beta": "context-1m-2025-08-07", ...(providerConfig?.options?.aiGatewayHeaders || {}), } diff --git a/packages/opencode/test/provider/gitlab-duo.test.ts b/packages/opencode/test/provider/gitlab-duo.test.ts index c512a4590..86e08a792 100644 --- a/packages/opencode/test/provider/gitlab-duo.test.ts +++ b/packages/opencode/test/provider/gitlab-duo.test.ts @@ -198,6 +198,30 @@ test("GitLab Duo: config apiKey takes precedence over environment variable", asy }) }) +test("GitLab Duo: includes context-1m beta header in aiGatewayHeaders", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify({ + $schema: "https://opencode.ai/config.json", + }), + ) + }, + }) + await Instance.provide({ + directory: tmp.path, + init: async () => { + Env.set("GITLAB_TOKEN", "test-token") + }, + fn: async () => { + const providers = await Provider.list() + expect(providers["gitlab"]).toBeDefined() + expect(providers["gitlab"].options?.aiGatewayHeaders?.["anthropic-beta"]).toContain("context-1m-2025-08-07") + }, + }) +}) + test("GitLab Duo: supports feature flags configuration", async () => { await using tmp = await tmpdir({ init: async (dir) => { |
