From af035f38727065e2e66167fbb245a6a6f403f696 Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 13:43:55 +0000 Subject: [PATCH 01/11] fix(runtime): re-anchor source patches for T3 0.1.11 and current Nightly Upstream 0.1.11 renamed linkAntigravityUserSkills to linkAntigravityUserConfig, dropped customModelCapabilityOverrides, and absorbed headless Antigravity sign-in natively (codeLogin), so the fail-closed agent-resources and gateway-context anchors no longer matched and the antigravity-sign-in backport became redundant. Re-anchor both patches, drop the backport, and move the bundled runtime pin to 0.1.11 so source builds work again on both matrix legs. --- Dockerfile | 2 +- docker/runtime/patches/agent-resources.mjs | 4 +- .../runtime/patches/antigravity-sign-in.mjs | 133 ------------------ .../patches/antigravity-terminal-login.ts | 86 ----------- docker/runtime/patches/gateway-context.mjs | 10 +- docker/runtime/patches/index.mjs | 2 - tests/agent-resources-patch.test.mjs | 2 +- tests/gateway-context-patch.test.mjs | 4 +- tests/nightly-4616-runtime-patches.test.mjs | 4 +- 9 files changed, 15 insertions(+), 232 deletions(-) delete mode 100644 docker/runtime/patches/antigravity-sign-in.mjs delete mode 100644 docker/runtime/patches/antigravity-terminal-login.ts diff --git a/Dockerfile b/Dockerfile index 04c448a..d8d2af3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -207,7 +207,7 @@ COPY --from=t3-build-node /usr/local/bin/node /usr/local/bin/node COPY docker/runtime/ /src/docker/runtime/ COPY scripts/build-t3-runtime.mjs /src/scripts/build-t3-runtime.mjs # The one bundled version pin; scripts/bump-versions.sh refreshes it. -ARG T3_VERSION=0.1.10 +ARG T3_VERSION=0.1.11 ARG TARGETARCH ENV npm_config_store_dir=/var/cache/pnpm RUN --mount=type=cache,target=/var/cache/pnpm set -eux; \ diff --git a/docker/runtime/patches/agent-resources.mjs b/docker/runtime/patches/agent-resources.mjs index 0d6df4b..7586149 100644 --- a/docker/runtime/patches/agent-resources.mjs +++ b/docker/runtime/patches/agent-resources.mjs @@ -13,7 +13,9 @@ export function patchAgentResources(source) { next[file] = next[file].replace(before, after); }; change(files[0], 'import * as NodeFSP from "node:fs/promises";', 'import * as NodeFSP from "node:fs/promises";\nimport { linkAntigravityUserResources } from "./antigravityUserResources.ts";'); - change(files[0], ' yield* linkAntigravityUserSkills({ profileDirectory: geminiHome, userHome, platform });', ` yield* linkAntigravityUserSkills({ profileDirectory: geminiHome, userHome, platform }); +// Reviewed against v0.1.11 (59651c1761f6c63e9b6056839067066968e6a406) and +// 0.1.12-nightly.20261121.5038: linkAntigravityUserSkills became linkAntigravityUserConfig. + change(files[0], ' yield* linkAntigravityUserConfig({ profileDirectory: geminiHome, userHome, platform });', ` yield* linkAntigravityUserConfig({ profileDirectory: geminiHome, userHome, platform }); yield* Effect.tryPromise(() => linkAntigravityUserResources(geminiHome, userHome)).pipe( Effect.mapError((error) => authSupportError(error instanceof Error ? error.message : "Antigravity global instructions and MCP settings could not be linked into its T3 profile.")), );`); diff --git a/docker/runtime/patches/antigravity-sign-in.mjs b/docker/runtime/patches/antigravity-sign-in.mjs deleted file mode 100644 index 9209b4c..0000000 --- a/docker/runtime/patches/antigravity-sign-in.mjs +++ /dev/null @@ -1,133 +0,0 @@ -import { readFileSync } from "node:fs"; - -const authFile = "apps/server/src/provider/AntigravityAuth.ts"; -const driverFile = "apps/server/src/provider/Drivers/AntigravityDriver.ts"; -export const files = [authFile, driverFile]; -export const creates = ["apps/server/src/provider/antigravityTerminalLogin.ts"]; -export const assets = [new URL("./antigravity-terminal-login.ts", import.meta.url)]; - -export function patchAntigravitySignIn(source) { - const next = { ...source }; - const drift = (file) => new Error(`The Antigravity sign-in patch no longer matches ${file}. Review the upstream source before publishing.`); - const change = (file, before, after) => { - if (typeof next[file] !== "string" || next[file].split(before).length !== 2) throw drift(file); - next[file] = next[file].replace(before, after); - }; - if (Object.hasOwn(next, creates[0])) throw drift(creates[0]); - next[creates[0]] = readFileSync(assets[0], "utf8"); - - change(authFile, 'import type { ProviderAuthController }', `import type { AntigravityTerminalChallenge } from "./antigravityTerminalLogin.ts"; -import type { ProviderAuthController }`); - change(authFile, ' readonly usesBrowser?: boolean;', ` readonly usesBrowser?: boolean; - readonly terminalLogin?: (onChallenge: AntigravityTerminalChallenge) => - Effect.Effect;`); - change(authFile, ' callbackSent: boolean;', ` callbackSent: boolean; - submitCode?: Parameters[1] | undefined;`); - change(authFile, 'const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError);', `const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError); -const needsTerminalLogin = (error: unknown) => - isAcpRequestError(error) && error.method === "authenticate" && error.code === -32603 && - error.errorMessage.startsWith("No browser is available here") && - error.errorMessage.includes("agy acp --login");`); - change(authFile, ' phase: Exit.isSuccess(result) ? "succeeded" : "failed",', ` phase: Exit.isSuccess(result) ? "succeeded" : "failed", - interaction: null,`); - change(authFile, ' flow.pending = undefined;\n yield* publishFlow(flow, {', ' flow.pending = undefined;\n flow.submitCode = undefined;\n yield* publishFlow(flow, {'); - change(authFile, ' phase,\n authorizationUrl: null,', ' phase,\n interaction: null,\n authorizationUrl: null,'); - change(authFile, ' phase: "cancelled",\n authorizationUrl: null,', ' phase: "cancelled",\n interaction: null,\n authorizationUrl: null,'); - change(authFile, ' interaction:\n state.phase === "waiting" && state.authorizationUrl && state.flowId', - ' interaction: state.interaction ?? (\n state.phase === "waiting" && state.authorizationUrl && state.flowId'); - change(authFile, ' acceptsCallback: true,\n }\n : null,', - ' acceptsCallback: true,\n }\n : null),'); - - const oldRunStart = ' const runtime = yield* options.makeRuntime({\n onAuthorizationUrl: (url) => receiveAuthorizationUrl(flow, url),\n });'; - const oldRunEnd = ' yield* options.onAuthenticated(started, runtime);'; - const auth = next[authFile]; - const startAcp = auth.indexOf(oldRunStart); - const endAcp = auth.indexOf(oldRunEnd, startAcp) + oldRunEnd.length; - if (startAcp < 0 || endAcp < startAcp || auth.split(oldRunStart).length !== 2 || - auth.split(oldRunEnd).length !== 2) throw drift(authFile); - const runAcp = auth.slice(startAcp, endAcp).split("\n").map(line => line ? " " + line : line).join("\n"); - change(authFile, auth.slice(startAcp, endAcp), ` const runAcp = Effect.gen(function* () { -${runAcp} - }).pipe(Effect.scoped); - const terminalLogin = options.terminalLogin; - yield* terminalLogin ? runAcp.pipe(Effect.catchIf(needsTerminalLogin, () => - terminalLogin((url, submit) => lock.withPermits(1)( - Effect.gen(function* () { - if (activeFlow !== flow || operation !== "auth") return; - flow.submitCode = submit; - yield* publishFlow(flow, { - ...flow.state, - phase: "waiting", - authorizationUrl: url, - message: "Open Google sign-in and paste the authorization code.", - interaction: { - type: "credentials", id: flow.id, - fields: [{ name: "authorizationCode", label: "Google authorization code", secret: true }], - }, - }); - }), - )).pipe(Effect.scoped, Effect.andThen(runAcp)), - )) : runAcp;`); - change(authFile, ' complete: Effect.fn("AntigravityAuth.complete")', ` respond: Effect.fn("AntigravityAuth.respond")(function* (ownerSessionId, input) { - return yield* lock.withPermits(1)(Effect.gen(function* () { - const flow = yield* requireFlow(ownerSessionId, input.flowId, "respond"); - if (!flow.submitCode || flow.state.phase !== "waiting" || input.interactionId !== flow.id) { - return yield* setupError("respond", "This Google authorization code request is no longer active."); - } - const code = input.response.type === "credentials" ? input.response.values.authorizationCode?.trim() : undefined; - if (!code || !/^[!-~]{1,4096}$/u.test(code)) { - return yield* setupError("respond", "Paste the authorization code shown by Google."); - } - yield* flow.submitCode(code); - flow.submitCode = undefined; - flow.callbackSent = true; - yield* publishFlow(flow, { - ...flow.state, - phase: "verifying", - interaction: null, - authorizationUrl: null, - message: "Waiting for Google to finish sign-in.", - }); - return flow.state; - })); - }), - complete: Effect.fn("AntigravityAuth.complete")`); - - change(driverFile, 'import { makeAntigravityAuth, type AntigravityAuth }', `import { runAntigravityTerminalLogin, type AntigravityTerminalChallenge } from "../antigravityTerminalLogin.ts"; -import { makeAntigravityAuth, type AntigravityAuth }`); - const driver = next[driverFile]; - const runtimeDeclaration = ' const makeRuntime = Effect.fn("AntigravityDriver.makeRuntime")'; - const signature = driver.indexOf(runtimeDeclaration); - const body = driver.indexOf(' if (authConfigIssue !== null) {', signature); - const runtime = driver.indexOf(' const runtime = yield* makeAntigravityAcpRuntime({', body); - const threadEnv = driver.indexOf(' // \`buildAntigravityAcpSpawnInput\` sets', body); - if (signature < 0 || body < signature || runtime < body || - driver.split(runtimeDeclaration).length !== 2) throw drift(driverFile); - const end = threadEnv >= body && threadEnv < runtime ? threadEnv : runtime; - const preparation = driver.slice(body, end); - if (!preparation.includes('const profile = yield* prepareAntigravityProfile(') || - !preparation.includes('const runtimeTempDirectory = yield* Effect.acquireRelease(')) throw drift(driverFile); - change(driverFile, driver.slice(signature, end), ` const prepareRuntime = Effect.fn("AntigravityDriver.prepareRuntime")(function* () { -${preparation} return { executable, profile, runtimeTempDirectory }; - }); - -${driver.slice(signature, body)} const { executable, profile, runtimeTempDirectory } = yield* prepareRuntime(); -`); - change(driverFile, ' const authFlow: AntigravityAuth = yield* makeAntigravityAuth({', ` const terminalLogin = Effect.fn("AntigravityDriver.terminalLogin")(function* (onChallenge: AntigravityTerminalChallenge) { - const { executable, profile, runtimeTempDirectory } = yield* prepareRuntime(); - if (executable.harnessPath !== null) { - return yield* new ProviderSetupError({ instanceId, operation: "start", detail: "Terminal sign-in requires the Antigravity CLI." }); - } - const spawn = buildAntigravityAcpSpawnInput({ - installation: executable, profile, cwd: runtimeTempDirectory, - baseEnv: processEnvironment, auth, runtimeTempDirectory, - }); - yield* runAntigravityTerminalLogin(instanceId, { - command: spawn.command, args: spawn.args ?? [], cwd: runtimeTempDirectory, env: spawn.env ?? {}, - }, onChallenge).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)); - }); - - const authFlow: AntigravityAuth = yield* makeAntigravityAuth({ - ...(auth.authMethod === "oauth-personal" ? { terminalLogin } : {}),`); - return next; -} diff --git a/docker/runtime/patches/antigravity-terminal-login.ts b/docker/runtime/patches/antigravity-terminal-login.ts deleted file mode 100644 index 2020270..0000000 --- a/docker/runtime/patches/antigravity-terminal-login.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { stripVTControlCharacters } from "node:util"; -import { ProviderSetupError, type ProviderInstanceId } from "@t3tools/contracts"; -import * as Deferred from "effect/Deferred"; -import * as Effect from "effect/Effect"; -import * as Stream from "effect/Stream"; -import * as ChildProcess from "effect/process/ChildProcess"; -import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner"; - -export type AntigravityTerminalChallenge = ( - url: string, - submit: (code: string) => Effect.Effect, -) => Effect.Effect; - -function authorizationUrl(line: string): string | undefined { - const value = stripVTControlCharacters(line).trim(); - if (!value.startsWith("https://accounts.google.com/") || value.length > 16_384 || /\s/u.test(value)) return; - const url = URL.parse(value); - if (!url || url.origin !== "https://accounts.google.com" || url.username || url.password || url.hash) return; - if (url.pathname !== "/o/oauth2/auth" && url.pathname !== "/o/oauth2/v2/auth") return; - const params = url.searchParams; - const single = (key: string) => params.getAll(key).length === 1 ? params.get(key) : null; - if ( - single("redirect_uri") !== "https://antigravity.google/oauth-callback" || - single("response_type") !== "code" || !single("state") || !single("code_challenge") || - single("code_challenge_method") !== "S256" - ) return; - return value; -} - -export const runAntigravityTerminalLogin = Effect.fn("AntigravityTerminalLogin.run")(function* ( - instanceId: ProviderInstanceId, - input: { command: string; args: ReadonlyArray; cwd: string; env: NodeJS.ProcessEnv }, - onChallenge: AntigravityTerminalChallenge, -) { - const error = (detail: string) => new ProviderSetupError({ instanceId, operation: "start", detail }); - const unavailable = error("Antigravity could not start its terminal sign-in. Try again."); - const challenge = yield* Deferred.make(); - const code = yield* Deferred.make(); - const inputStream = Stream.fromEffect(Deferred.await(code).pipe( - Effect.map((value) => new TextEncoder().encode(`${value}\n`)), - )); - const env = { ...input.env }; - delete env.DISPLAY; - delete env.WAYLAND_DISPLAY; - delete env.BROWSER; - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const child = yield* spawner.spawn(ChildProcess.make(input.command, [...input.args, "--login"], { - cwd: input.cwd, env, extendEnv: false, shell: false, - stdin: inputStream, stdout: "pipe", stderr: "ignore", forceKillAfter: "1 second", - })).pipe(Effect.mapError(() => unavailable)); - - // OAuth output may include secrets. Keep only the first validated link and drain the rest. - const decoder = new TextDecoder(); - let pending = ""; - let bytes = 0; - let found = false; - yield* Stream.runForEach(child.stdout, (chunk) => Effect.suspend(() => { - if (found) return Effect.void; - bytes += chunk.length; - if (bytes > 32_768) return Deferred.fail(challenge, unavailable).pipe(Effect.asVoid); - const lines = (pending + decoder.decode(chunk, { stream: true })).split("\n"); - pending = lines.pop() ?? ""; - for (const line of lines) { - const url = authorizationUrl(line); - if (url) { - found = true; - pending = ""; - return Deferred.succeed(challenge, url).pipe(Effect.asVoid); - } - } - return Effect.void; - })).pipe( - Effect.andThen(Deferred.fail(challenge, unavailable)), - Effect.catch(() => Deferred.fail(challenge, unavailable)), - Effect.forkScoped, - ); - const url = yield* Deferred.await(challenge).pipe(Effect.timeoutOrElse({ - duration: "30 seconds", - orElse: () => Effect.fail(unavailable), - })); - yield* onChallenge(url, (value) => Deferred.succeed(code, value).pipe(Effect.asVoid)); - const status = yield* child.exitCode.pipe(Effect.mapError(() => unavailable)); - if (Number(status) !== 0 || !(yield* Deferred.isDone(code))) { - return yield* error("Google sign-in did not accept the authorization code. Start sign-in again."); - } -}); diff --git a/docker/runtime/patches/gateway-context.mjs b/docker/runtime/patches/gateway-context.mjs index 21dd746..ff3ca83 100644 --- a/docker/runtime/patches/gateway-context.mjs +++ b/docker/runtime/patches/gateway-context.mjs @@ -73,10 +73,12 @@ export function patchGatewayContext(source) { ` canApplyClaudeSelectionLive(existing.selection, compiledSelection) && claudeGatewayContextKey(adapterOptions.environment, existing.selection.apiModelId) === claudeGatewayContextKey(adapterOptions.environment, compiledSelection.apiModelId) &&`); - change(files[1], ' customModelCapabilityOverrides: Schema.optionalKey(Schema.Boolean),', - ' customModelCapabilityOverrides: Schema.optionalKey(Schema.Boolean),\n gatewayModelLimits: Schema.optionalKey(Schema.Boolean),'); - change(files[2], ' customModelCapabilityOverrides: true,', - ' customModelCapabilityOverrides: true,\n gatewayModelLimits: true,'); + // Reviewed against v0.1.11 (59651c1761f6c63e9b6056839067066968e6a406) and + // 0.1.12-nightly.20261121.5038: upstream dropped customModelCapabilityOverrides. + change(files[1], ' threadFind: Schema.optionalKey(Schema.Boolean),', + ' threadFind: Schema.optionalKey(Schema.Boolean),\n gatewayModelLimits: Schema.optionalKey(Schema.Boolean),'); + change(files[2], ' threadFind: true,', + ' threadFind: true,\n gatewayModelLimits: true,'); next[creates[0]] = readFileSync(assets[0], 'utf8'); return next; } diff --git a/docker/runtime/patches/index.mjs b/docker/runtime/patches/index.mjs index 373d42c..428beab 100644 --- a/docker/runtime/patches/index.mjs +++ b/docker/runtime/patches/index.mjs @@ -1,6 +1,5 @@ import * as agentResources from "./agent-resources.mjs"; import * as antigravityRuntime from "./antigravity-runtime.mjs"; -import * as antigravitySignIn from "./antigravity-sign-in.mjs"; import * as opencodeSkills from "./opencode-skills.mjs"; import * as projectDirectory from "./project-directory.mjs"; import * as setupPalette from "./setup-palette.mjs"; @@ -12,7 +11,6 @@ import * as gatewayQuota from "./gateway-quota.mjs"; export const BUILD_REVISION = 5; export const patches = [{ name: "agent-resources", module: new URL("./agent-resources.mjs", import.meta.url), files: agentResources.files, creates: agentResources.creates, assets: agentResources.assets, apply: agentResources.patchAgentResources }, { name: "antigravity-runtime", module: new URL("./antigravity-runtime.mjs", import.meta.url), files: antigravityRuntime.files, apply: antigravityRuntime.patchAntigravityRuntime }, - { name: "antigravity-sign-in", module: new URL("./antigravity-sign-in.mjs", import.meta.url), files: antigravitySignIn.files, creates: antigravitySignIn.creates, assets: antigravitySignIn.assets, apply: antigravitySignIn.patchAntigravitySignIn }, { name: "project-directory", module: new URL("./project-directory.mjs", import.meta.url), files: projectDirectory.files, apply: projectDirectory.patchProjectDirectory }, { name: "gateway-capabilities", module: new URL("./gateway-capabilities.mjs", import.meta.url), files: gatewayCapabilities.files, apply: gatewayCapabilities.patchGatewayCapabilities }, { name: "gateway-context", module: new URL("./gateway-context.mjs", import.meta.url), files: gatewayContext.files, creates: gatewayContext.creates, assets: gatewayContext.assets, apply: gatewayContext.patchGatewayContext }, diff --git a/tests/agent-resources-patch.test.mjs b/tests/agent-resources-patch.test.mjs index 2726a51..89a9638 100644 --- a/tests/agent-resources-patch.test.mjs +++ b/tests/agent-resources-patch.test.mjs @@ -105,7 +105,7 @@ test('Cursor keeps its primary project, source layers and tool protocol while ad test('the resource bridges are registered and reject source drift and repeated application', () => { const source = { - [files[0]]: 'import * as NodeFSP from "node:fs/promises";\n yield* linkAntigravityUserSkills({ profileDirectory: geminiHome, userHome, platform });', + [files[0]]: 'import * as NodeFSP from "node:fs/promises";\n yield* linkAntigravityUserConfig({ profileDirectory: geminiHome, userHome, platform });', [files[1]]: 'import * as CursorAgentSdk from "./CursorAgentSdk.ts";\n.open({ ...input, options: { ...input.options, apiKey } })', }; const next = patchAgentResources(source); diff --git a/tests/gateway-context-patch.test.mjs b/tests/gateway-context-patch.test.mjs index 156946d..e331e0b 100644 --- a/tests/gateway-context-patch.test.mjs +++ b/tests/gateway-context-patch.test.mjs @@ -71,8 +71,8 @@ const source = { } as ClaudeSdkSettings); canApplyClaudeSelectionLive(existing.selection, compiledSelection) && nextCondition`, - [files[1]]: ' customModelCapabilityOverrides: Schema.optionalKey(Schema.Boolean),', - [files[2]]: ' customModelCapabilityOverrides: true,', + [files[1]]: ' threadFind: Schema.optionalKey(Schema.Boolean),', + [files[2]]: ' threadFind: true,', }; test('the runtime contract includes the helper, initial settings, and switch guard and rejects upstream drift', () => { const result = patchGatewayContext(source); diff --git a/tests/nightly-4616-runtime-patches.test.mjs b/tests/nightly-4616-runtime-patches.test.mjs index 42f8b5b..e29971f 100644 --- a/tests/nightly-4616-runtime-patches.test.mjs +++ b/tests/nightly-4616-runtime-patches.test.mjs @@ -13,8 +13,8 @@ const settingsFixture = readFileSync(new URL('./fixtures/claude-query-settings-n const adapter = (settings) => `import * as DocumentText from "../../provider/DocumentText.ts";\n${settings}\n canApplyClaudeSelectionLive(existing.selection, compiledSelection) &&\n nextCondition`; const claudeSource = { [claudeFiles[0]]: adapter(settingsFixture), - [claudeFiles[1]]: ' customModelCapabilityOverrides: Schema.optionalKey(Schema.Boolean),', - [claudeFiles[2]]: ' customModelCapabilityOverrides: true,', + [claudeFiles[1]]: ' threadFind: Schema.optionalKey(Schema.Boolean),', + [claudeFiles[2]]: ' threadFind: true,', }; const helper = readFileSync(new URL('../docker/runtime/patches/gateway-context.ts', import.meta.url), 'utf8'); const apply = new Function(stripTypeScriptTypes(helper.replaceAll('export ', '')) + '\nreturn applyClaudeGatewayContext;')(); From 15b84391a6b8f52d3f2ecbe6011ce1a34bf11d46 Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:01:03 +0000 Subject: [PATCH 02/11] fix(smoke): answer the Nightly hub's routed-models endpoint Upstream 0.1.12-nightly.20261121.5038 asks each hub account for its routed models before reading quota. The cliproxy smoke fixture had no handler, so every request fell into its error-tracking assert. Answer with an empty model list, which upstream treats as the older-hub behavior the smoke already asserts. --- scripts/lib/gateway-quota-smoke.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/lib/gateway-quota-smoke.mjs b/scripts/lib/gateway-quota-smoke.mjs index cf793ea..a79c297 100644 --- a/scripts/lib/gateway-quota-smoke.mjs +++ b/scripts/lib/gateway-quota-smoke.mjs @@ -30,6 +30,9 @@ export async function verifyGatewayQuota({ api, gatewayT3, until }) { assert.equal(url.searchParams.get("name"), "muse.json"); return send({ dca_token: "dca:fixture-only", api_key: "LLM|private-fixture" }); } + // Nightly hubs ask which models an account routes to; empty keeps the + // older-hub behavior the smoke asserts (every model of its driver). + if (url.pathname.endsWith("/auth-files/models")) return send({ models: [] }); if (url.pathname.endsWith("/quota/fetch")) { assert.equal(body.auth_index, "go"); assert.equal(body.plugin_id, "opencode-plugin"); return failing ? send({ error: "private-fixture-error" }, 501) : send(grouped); From 6710af1d0c94b19c7635c37206856ea64b666eef Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:13:01 +0000 Subject: [PATCH 03/11] fix(smoke): follow upstream's native Antigravity code login The integration smoke still exercised our removed backport's contract. Follow the native flow instead: the login spawn keeps the browser suppression helper (only the display is stripped), a malformed sign-in link fails the stream instead of being ignored, the credentials field is upstream's code field, and the runtime no longer advertises customModelCapabilityOverrides, which upstream removed in 0.1.11. --- scripts/fixtures/antigravity-acp.mjs | 4 ++-- scripts/t3-integration-smoke.mjs | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/fixtures/antigravity-acp.mjs b/scripts/fixtures/antigravity-acp.mjs index b2e7509..8eb3555 100644 --- a/scripts/fixtures/antigravity-acp.mjs +++ b/scripts/fixtures/antigravity-acp.mjs @@ -8,10 +8,10 @@ const input = createInterface({ input: process.stdin }); if (process.argv.includes("--login")) { assert.equal(process.env.DISPLAY, undefined); - assert.equal(process.env.BROWSER, undefined); + // The native login keeps the browser suppression helper and only strips the display. + assert.ok((process.env.BROWSER ?? "").includes("'-e'")); const params = new URLSearchParams({ redirect_uri: "https://antigravity.google/oauth-callback", response_type: "code", state: "fixture-state", code_challenge: "fixture-challenge", code_challenge_method: "S256" }); - console.log("https://accounts.google.com/o/oauth2/auth?redirect_uri=https%3A%2F%2Fwrong.example"); console.log(`https://accounts.google.com/o/oauth2/auth?${params}`); for await (const code of input) { assert.equal(code, "fixture-authorization-code"); diff --git a/scripts/t3-integration-smoke.mjs b/scripts/t3-integration-smoke.mjs index ae889a5..b297d1e 100644 --- a/scripts/t3-integration-smoke.mjs +++ b/scripts/t3-integration-smoke.mjs @@ -161,10 +161,10 @@ exec "$T3_INFRA_NODE" "$@" const { flowId } = await api.call("provider.auth.start", authInput); const challenge = await waitForCode(flowId); assert.equal(new URL(challenge.authorizationUrl).searchParams.get("redirect_uri"), "https://antigravity.google/oauth-callback"); - assert.deepEqual(challenge.interaction.fields, [{ name: "authorizationCode", label: "Google authorization code", secret: true }]); - const respond = (authorizationCode) => api.call("provider.auth.respond", { ...authInput, flowId, - interactionId: challenge.interaction.id, response: { type: "credentials", values: { authorizationCode } } }); - await assert.rejects(respond("wrong\nline"), /authorization code shown by Google/); + assert.deepEqual(challenge.interaction.fields, [{ name: "code", label: "Code from the Antigravity page", secret: false }]); + const respond = (code) => api.call("provider.auth.respond", { ...authInput, flowId, + interactionId: challenge.interaction.id, response: { type: "credentials", values: { code } } }); + await assert.rejects(respond("wrong\nline"), /Paste the code from the Antigravity page/); await respond("fixture-authorization-code"); const signedIn = await until(async () => { const state = await api.first("provider.auth.subscribe", authInput); @@ -175,8 +175,9 @@ exec "$T3_INFRA_NODE" "$@" const [browserCommand, fd, serializationMode] = (await until(() => fs.readFile(browserReceipt, "utf8"))).trimEnd().split("\n"); assert.ok(browserCommand.startsWith(`'${process.execPath}' '-e' `), "Antigravity uses the image Node even when PATH prefers a broken shim"); assert.deepEqual([fd, serializationMode], ["unset", "unset"], "The Antigravity subprocess receives no launcher IPC metadata"); - // The new capability contract belongs to the patched server, not upstream. - assert.equal((await gatewayT3.read()).customModelCapabilityOverrides, true, "the selected patched runtime advertises capability overrides"); + // Upstream 0.1.11 dropped its capability-override advertisement; the patched + // runtime must not resurrect it, and gateway limits remain our own contract. + assert.equal((await gatewayT3.read()).customModelCapabilityOverrides, false, "upstream removed the capability-override contract"); assert.equal((await gatewayT3.read()).gatewayModelLimits, true, "the upgraded runtime advertises gateway context-limit support"); const richCustomModels = [{ slug: "smoke-model", capabilities: { optionDescriptors: [{ id: "reasoningEffort", label: "Reasoning", type: "select", options: [{ id: "ultra", label: "ultra" }] }] } }, { slug: "smoke-unknown", capabilities: { optionDescriptors: [] } }]; await gatewayT3.upsert(gatewayInstance, { driver: "codex", displayName: "Codex · Smoke", enabled: false, config: { customModels: richCustomModels } }); From 30019c4ea0c06fb2a130394d23af3454b300a5fd Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:15:58 +0000 Subject: [PATCH 04/11] fix(tests): pin the smoke's capability contract to upstream 0.1.11 Upstream removed customModelCapabilityOverrides, so the patched runtime no longer advertises it and the smoke asserts false on both sides of the upgrade; gatewayModelLimits stays the patched-runtime proof. --- tests/native-build-config.test.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/native-build-config.test.mjs b/tests/native-build-config.test.mjs index d062569..048061c 100644 --- a/tests/native-build-config.test.mjs +++ b/tests/native-build-config.test.mjs @@ -99,7 +99,10 @@ test('integration smoke checks capability negotiation on the correct side of the assert.match(upstream, /gatewayRead\.customModelCapabilityOverrides, false/); assert.match(upstream, /const customModels = \["smoke-model"\]/); assert.doesNotMatch(upstream, /customModelCapabilityOverrides, true/); - assert.match(patched, /gatewayT3\.read\(\)\)\.customModelCapabilityOverrides, true/); + // Upstream 0.1.11 dropped the capability-override advertisement; gateway + // limits remain the contract the patched runtime adds on top of upstream. + assert.match(patched, /gatewayT3\.read\(\)\)\.customModelCapabilityOverrides, false/); + assert.match(patched, /gatewayT3\.read\(\)\)\.gatewayModelLimits, true/); assert.match(patched, /customModels: richCustomModels/); assert.match(patched, /config\.customModels, richCustomModels/); }); From 84e38ca070e7786635be674d076be7bccdea560b Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:24:36 +0000 Subject: [PATCH 05/11] fix(smoke): a cancelled native flow omits the optional interaction key Upstream's ProviderAuthState makes interaction optional and drops it when none is offered; the backport used to publish an explicit null. --- scripts/t3-integration-smoke.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/t3-integration-smoke.mjs b/scripts/t3-integration-smoke.mjs index b297d1e..e2d9093 100644 --- a/scripts/t3-integration-smoke.mjs +++ b/scripts/t3-integration-smoke.mjs @@ -157,7 +157,8 @@ exec "$T3_INFRA_NODE" "$@" await waitForCode(first.flowId); const cancelled = await api.call("provider.auth.cancel", { ...authInput, flowId: first.flowId }); assert.equal(cancelled.phase, "cancelled"); - assert.equal(cancelled.interaction, null); + // Upstream's state omits the optional interaction key once none is offered. + assert.equal(cancelled.interaction ?? null, null); const { flowId } = await api.call("provider.auth.start", authInput); const challenge = await waitForCode(flowId); assert.equal(new URL(challenge.authorizationUrl).searchParams.get("redirect_uri"), "https://antigravity.google/oauth-callback"); From fe64d1867ea4f3f8f209e4d93c4f6c9a1db5e5f8 Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:35:05 +0000 Subject: [PATCH 06/11] fix(smoke): restore the patched capability-override assertion The customModelCapabilityOverrides advertisement is this repo's own gateway-capabilities patch, not an upstream key; the earlier flip to false confused it with the upstream schema key that gateway-context used as an anchor before this PR re-anchored it. --- scripts/t3-integration-smoke.mjs | 5 ++--- tests/native-build-config.test.mjs | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/t3-integration-smoke.mjs b/scripts/t3-integration-smoke.mjs index e2d9093..9b39526 100644 --- a/scripts/t3-integration-smoke.mjs +++ b/scripts/t3-integration-smoke.mjs @@ -176,9 +176,8 @@ exec "$T3_INFRA_NODE" "$@" const [browserCommand, fd, serializationMode] = (await until(() => fs.readFile(browserReceipt, "utf8"))).trimEnd().split("\n"); assert.ok(browserCommand.startsWith(`'${process.execPath}' '-e' `), "Antigravity uses the image Node even when PATH prefers a broken shim"); assert.deepEqual([fd, serializationMode], ["unset", "unset"], "The Antigravity subprocess receives no launcher IPC metadata"); - // Upstream 0.1.11 dropped its capability-override advertisement; the patched - // runtime must not resurrect it, and gateway limits remain our own contract. - assert.equal((await gatewayT3.read()).customModelCapabilityOverrides, false, "upstream removed the capability-override contract"); + // The new capability contract belongs to the patched server, not upstream. + assert.equal((await gatewayT3.read()).customModelCapabilityOverrides, true, "the selected patched runtime advertises capability overrides"); assert.equal((await gatewayT3.read()).gatewayModelLimits, true, "the upgraded runtime advertises gateway context-limit support"); const richCustomModels = [{ slug: "smoke-model", capabilities: { optionDescriptors: [{ id: "reasoningEffort", label: "Reasoning", type: "select", options: [{ id: "ultra", label: "ultra" }] }] } }, { slug: "smoke-unknown", capabilities: { optionDescriptors: [] } }]; await gatewayT3.upsert(gatewayInstance, { driver: "codex", displayName: "Codex · Smoke", enabled: false, config: { customModels: richCustomModels } }); diff --git a/tests/native-build-config.test.mjs b/tests/native-build-config.test.mjs index 048061c..d062569 100644 --- a/tests/native-build-config.test.mjs +++ b/tests/native-build-config.test.mjs @@ -99,10 +99,7 @@ test('integration smoke checks capability negotiation on the correct side of the assert.match(upstream, /gatewayRead\.customModelCapabilityOverrides, false/); assert.match(upstream, /const customModels = \["smoke-model"\]/); assert.doesNotMatch(upstream, /customModelCapabilityOverrides, true/); - // Upstream 0.1.11 dropped the capability-override advertisement; gateway - // limits remain the contract the patched runtime adds on top of upstream. - assert.match(patched, /gatewayT3\.read\(\)\)\.customModelCapabilityOverrides, false/); - assert.match(patched, /gatewayT3\.read\(\)\)\.gatewayModelLimits, true/); + assert.match(patched, /gatewayT3\.read\(\)\)\.customModelCapabilityOverrides, true/); assert.match(patched, /customModels: richCustomModels/); assert.match(patched, /config\.customModels, richCustomModels/); }); From fe4661431959ea321313bdcf7b30def2ddc2b4db Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:51:10 +0000 Subject: [PATCH 07/11] fix(services): bump cloudflared pin to 2026.11.1 T3 Code requires a relay client >= 2026.10.3 and rejects the image's 2026.5.2 shim, falling into a log-spamming install loop and leaving the tunnel down. Pin 2026.11.1 (latest stable) and make the smoke test fail if the pin ever drops below T3 Code's floor again. --- Dockerfile | 2 +- scripts/service-catalogue.mjs | 2 +- scripts/smoke-test.sh | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d8d2af3..ab79413 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,7 +105,7 @@ RUN set -eux; \ # Optional payload metadata is image-owned. No server or connector payload is # installed here. Native T3 tunnels use the compatible lazy cloudflared shim. -ARG CLOUDFLARED_VERSION=2026.5.2 +ARG CLOUDFLARED_VERSION=2026.11.1 ARG TAILSCALE_VERSION=1.104.5 COPY scripts/service-catalogue.mjs /tmp/service-catalogue.mjs RUN set -eux; \ diff --git a/scripts/service-catalogue.mjs b/scripts/service-catalogue.mjs index 630fbff..2482477 100644 --- a/scripts/service-catalogue.mjs +++ b/scripts/service-catalogue.mjs @@ -4,7 +4,7 @@ import { execFileSync } from "node:child_process"; import { writeFileSync } from "node:fs"; import { createHash } from "node:crypto"; -const [output, tailscale = "1.104.5", cloudflared = "2026.5.2"] = process.argv.slice(2); +const [output, tailscale = "1.104.5", cloudflared = "2026.11.1"] = process.argv.slice(2); const arch = execFileSync("/usr/bin/dpkg", ["--print-architecture"], { encoding: "utf8" }).trim(); if (!["amd64", "arm64"].includes(arch)) throw new Error("Unsupported optional service architecture"); const entries = []; diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index b961109..69ed187 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -1780,11 +1780,13 @@ check "T3 Code is pointed at the on-demand adapter" \ cloudflared_matches_t3() { local want have # The binary distribution has no greppable server bundle, so the Dockerfile - # pin is the compatibility assertion. + # pin is the compatibility assertion. T3 Code refuses relay clients older + # than 2026.10.3 and falls back to a log-spamming install loop. want="$(grep -m1 '^ARG CLOUDFLARED_VERSION=' Dockerfile | cut -d= -f2)" have="$(docker exec "$NAME" cloudflared --version 2>/dev/null | awk '{print $3}')" CF_WANT="$want"; CF_HAVE="$have" - [ "$want" = "$have" ] + [ "$want" = "$have" ] && \ + [ "$(printf '%s\n2026.10.3\n' "$want" | sort -V | head -1)" = "2026.10.3" ] } if cloudflared_matches_t3; then ok "cloudflared ${CF_HAVE:-?} is the release T3 Code asks for" From d6d49a0eab3268c4280c9383e0d74039a7f7bce5 Mon Sep 17 00:00:00 2001 From: 0libote <79215282+0libote@users.noreply.github.com> Date: Sat, 21 Nov 2026 15:00:02 +0000 Subject: [PATCH 08/11] fix(smoke): read the OpenCode floor from T3 0.1.11's compat table 0.1.11 replaced the compiled MINIMUM_OPENCODE_VERSION constant with an embedded driver-compat manifest; take the broken-range boundary as the floor T3 enforces. 1.14.19 stays the floor, so the catalogue and the installed 1.19.6 still meet it. Also carry the cloudflared 2026.11.1 bump from #153: the newer bundled runtime enforces its 2026.10.3 relay floor, so without it the image's Connect status is never 'available'. --- scripts/smoke-test.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 69ed187..3f0f73d 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -1341,9 +1341,16 @@ check "native cache cleanup preserves shared dependencies and stays inside revie # raises it slips through until someone's session fails. opencode_floor_matches_t3() { local declared catalogue installed - declared="$(docker exec "$NAME" sh -c \ - "grep -a -o 'MINIMUM_OPENCODE_VERSION *= *\"[0-9][0-9.]*\"' $T3_BUNDLE | head -1" 2>/dev/null \ - | grep -o '[0-9][0-9.]*' | head -1)" + # 0.1.11 dropped the compiled MINIMUM_OPENCODE_VERSION constant for a + # driver-compat table; the broken-range boundary is the floor it enforces. + declared="$(docker exec -i "$NAME" node --input-type=module 2>/dev/null < part.includes('"t3CodeRange": ">=0.0.46"')); +const broken = /"range": "<([0-9.]+)",\s*"status": "broken"/.exec(entry ?? ""); +process.stdout.write(broken?.[1] ?? ""); +NODE +)" catalogue="$(docker exec "$NAME" sh -c \ "grep -o 'MINIMUM_OPENCODE_VERSION = \"[0-9.]*\"' /opt/t3-harness/catalogue.mjs" \ | grep -o '[0-9][0-9.]*')" From 87c7e854eb0fe8a5ea01182da57b7a92067e166d Mon Sep 17 00:00:00 2001 From: Ziyang Zeng Date: Sun, 22 Nov 2026 14:18:21 -0800 Subject: [PATCH 09/11] fix(smoke): poll for the captured Claude OAuth URL claude_url_complete slept a fixed 14s and asserted once. On the 2026-11-22 runs every smoke leg failed that check while the following checks drove the same sign-in session to completion, so the URL is captured, just later than 14s. Poll the session state for up to 90s instead of racing the login render. Co-Authored-By: Claude Code --- scripts/smoke-test.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 3f0f73d..e76f56b 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -1517,12 +1517,21 @@ signin_id() { # scraping the visible text yields a truncated URL missing the PKCE challenge # and state, which would send you to a sign-in page that cannot complete. claude_url_complete() { - local id + local id state id="$(signin_id claude)" [ -n "$id" ] || return 1 - sleep 14 - session_state "$id" | grep -q 'code_challenge' && - session_state "$id" | grep -q '"state":"awaiting-code"' + # Rendering the login URL can take well past a fixed wait on a cold or busy + # runner, and the session completes shortly after; poll for the captured + # URL instead of asserting once and racing it. + for _ in $(seq 1 45); do + state="$(session_state "$id")" + if printf %s "$state" | grep -q 'code_challenge' && + printf %s "$state" | grep -q '"state":"awaiting-code"'; then + return 0 + fi + sleep 2 + done + return 1 } check "Claude sign-in captures a complete OAuth URL" claude_url_complete From 488c99833ee64471094be0a8c7e5d286cdc719b1 Mon Sep 17 00:00:00 2001 From: Ziyang Zeng Date: Sun, 22 Nov 2026 14:38:49 -0800 Subject: [PATCH 10/11] fix(smoke): allow five minutes for the Claude OAuth capture The 90s poll still timed out on core arm64 while the same session completed in the following check, so the login render can take longer than that on current runners. Poll for up to five minutes, and on timeout leave a redacted note (session state, whether code_challenge was seen, response size) in the failure summary, since check() discards output and the failure was otherwise blind. Co-Authored-By: Claude Code --- scripts/smoke-test.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index e76f56b..4499d09 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -1521,9 +1521,9 @@ claude_url_complete() { id="$(signin_id claude)" [ -n "$id" ] || return 1 # Rendering the login URL can take well past a fixed wait on a cold or busy - # runner, and the session completes shortly after; poll for the captured - # URL instead of asserting once and racing it. - for _ in $(seq 1 45); do + # runner (over 90s was seen on 2026-11-22 while the same session then + # completed), so poll for the captured URL instead of racing it. + for _ in $(seq 1 150); do state="$(session_state "$id")" if printf %s "$state" | grep -q 'code_challenge' && printf %s "$state" | grep -q '"state":"awaiting-code"'; then @@ -1531,6 +1531,13 @@ claude_url_complete() { fi sleep 2 done + # check() discards output; leave a redacted note for the failure summary so + # the next timeout says which half of the capture never arrived. + local seen=no + printf %s "$state" | grep -q 'code_challenge' && seen=yes + printf 'Claude OAuth capture timed out: session state=%s, code_challenge seen=%s, response bytes=%s\n' \ + "$(printf %s "$state" | sed -n 's/.*"state":"\([^"]*\)".*/\1/p')" \ + "$seen" "$(printf %s "$state" | wc -c)" >> "$UI_AUDIT_LOG" return 1 } check "Claude sign-in captures a complete OAuth URL" claude_url_complete From 775c3673a4748b4a04e40d922bdac6368b20049a Mon Sep 17 00:00:00 2001 From: Ziyang Zeng Date: Sun, 22 Nov 2026 15:07:04 -0800 Subject: [PATCH 11/11] fix(smoke): accept Claude's opaque authorize URL as complete Anthropic changed the claude auth login URL server side: it no longer carries code_challenge and state as query parameters, but one opaque ?z- token with the challenge kept server side (verified against a clean 2.1.330 login render). Setup captures the new URL fine and the session completes, so only the smoke completeness assertion was obsolete. Accept the legacy long form only with its challenge and state, or the opaque form with a full length token, and report the captured form in the timeout diagnostic. Co-Authored-By: Claude Code --- scripts/smoke-test.sh | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 4499d09..e7b7d61 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -1514,30 +1514,47 @@ signin_id() { } # Claude renders its URL as an OSC-8 hyperlink wrapped over several lines; -# scraping the visible text yields a truncated URL missing the PKCE challenge -# and state, which would send you to a sign-in page that cannot complete. +# scraping the visible text yields a truncated URL, which would send you to a +# sign-in page that cannot complete. What "complete" means changed in +# November 2026: the authorize URL used to carry its PKCE code_challenge and +# state as query parameters, and now carries one opaque ?z- token instead, +# with the challenge kept server side. Accept either form whole, reject a +# truncated legacy URL that lost its tail parameters. +claude_url_is_complete() { + case "$1" in + "https://claude.ai/oauth/authorize"?*client_id=*) + case "$1" in *code_challenge=*state=*|*state=*code_challenge=*) return 0 ;; *) return 1 ;; esac ;; + "https://claude.ai/oauth/authorize?z-"*) + [ "${#1}" -ge 60 ] ;; + *) return 1 ;; + esac +} claude_url_complete() { - local id state + local id state url="" id="$(signin_id claude)" [ -n "$id" ] || return 1 # Rendering the login URL can take well past a fixed wait on a cold or busy - # runner (over 90s was seen on 2026-11-22 while the same session then - # completed), so poll for the captured URL instead of racing it. + # runner, so poll for the captured URL instead of racing it. for _ in $(seq 1 150); do state="$(session_state "$id")" - if printf %s "$state" | grep -q 'code_challenge' && - printf %s "$state" | grep -q '"state":"awaiting-code"'; then + url="$(printf %s "$state" | sed -n 's/.*"url":"\([^"]*\)".*/\1/p')" + if printf %s "$state" | grep -q '"state":"awaiting-code"' && + claude_url_is_complete "$url"; then return 0 fi sleep 2 done # check() discards output; leave a redacted note for the failure summary so # the next timeout says which half of the capture never arrived. - local seen=no - printf %s "$state" | grep -q 'code_challenge' && seen=yes - printf 'Claude OAuth capture timed out: session state=%s, code_challenge seen=%s, response bytes=%s\n' \ + local form=none + case "$url" in + *client_id=*) form=legacy ;; + "https://claude.ai/oauth/authorize?z-"*) form=opaque ;; + ?*) form=other ;; + esac + printf 'Claude OAuth capture timed out: session state=%s, url form=%s, url bytes=%s\n' \ "$(printf %s "$state" | sed -n 's/.*"state":"\([^"]*\)".*/\1/p')" \ - "$seen" "$(printf %s "$state" | wc -c)" >> "$UI_AUDIT_LOG" + "$form" "${#url}" >> "$UI_AUDIT_LOG" return 1 } check "Claude sign-in captures a complete OAuth URL" claude_url_complete