diegosouzapw/OmniRoute · error · Error
Trae ExchangeToken: response missing Result.Token
Error message
Trae ExchangeToken: response missing Result.Token
What it means
Error "Trae ExchangeToken: response missing Result.Token" thrown in diegosouzapw/OmniRoute.
Source
Thrown at open-sse/executors/trae.ts:471
if (!res.ok) {
throw new Error(`Trae ExchangeToken HTTP ${res.status}: ${text.slice(0, 200)}`);
}
let parsed;
try {
parsed = JSON.parse(text);
} catch {
throw new Error("Trae ExchangeToken: response was not JSON");
}
const errCode = parsed?.ResponseMetadata?.Error?.Code;
if (errCode) {
// Surface invalid-refresh to the caller — BaseExecutor.execute swallows the
// refresh exception, but the next request will hit 401 and trigger fallback;
// we also leave the (stale) accessToken in place so observability shows why.
throw new Error(`Trae ExchangeToken error: ${errCode}`);
}
const result = parsed?.Result;
if (!result?.Token) {
throw new Error("Trae ExchangeToken: response missing Result.Token");
}
return {
accessToken: result.Token as string,
refreshToken: (result.RefreshToken as string) || refreshToken,
expiresAt: result.TokenExpireAt
? new Date(Number(result.TokenExpireAt)).toISOString()
: undefined,
};
}
}
export default TraeExecutor;
View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at open-sse/executors/trae.ts:471 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/367aeb54212a4ed7.
Report an issue: GitHub.