From 7b9af6e6c215257f3d6ab50203dfee60d525894a Mon Sep 17 00:00:00 2001 From: "omegent-app[bot]" <306514130+omegent-app[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 12:49:40 +0000 Subject: [PATCH] fix(discord-bot): stop shadowing httpBaseUrl so steernow can load the queue connectPrepared's parameter was named httpBaseUrl, so the assignment that should record the connected base URL only mutated the parameter. Outer connection state stayed null, fetchThreadDetail always short-circuited, and /agent steernow reported "thread snapshot unavailable" while WS steering from desktop still worked. --- apps/discord-bot/src/t3/T3Session.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/discord-bot/src/t3/T3Session.ts b/apps/discord-bot/src/t3/T3Session.ts index 63da3ec240b..cc340f18b7d 100644 --- a/apps/discord-bot/src/t3/T3Session.ts +++ b/apps/discord-bot/src/t3/T3Session.ts @@ -404,10 +404,14 @@ export const makeT3Session = (botConfig: DiscordBotConfig) => ), ); - const connectPrepared = (httpBaseUrl: string, bearerToken?: string) => + // Parameter must not be named `httpBaseUrl` — that shadows the outer + // connection-state binding, so `httpBaseUrl = normalizedBaseUrl` would only + // mutate the parameter and leave outer state null forever. steernow and + // bridge HTTP reseed then always see "snapshot unavailable". + const connectPrepared = (baseUrl: string, bearerToken?: string) => Effect.tryPromise({ try: async () => { - const normalizedBaseUrl = new URL(httpBaseUrl).toString(); + const normalizedBaseUrl = new URL(baseUrl).toString(); if (session !== null) return; let environmentId = EnvironmentId.make(PRIMARY_LOCAL_ENVIRONMENT_ID);