fix(agent): Allow null refreshToken and expiresAt for setup tokens

Modified OAuthCredentials interface to support setup tokens that don't
have refresh tokens or expiry times:
- refreshToken: string | null
- expiresAt: number | null

Updated in both src/agent/accounts/usage.ts and
src/agent/credentials/types.ts for consistency.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-02-10 09:49:36 +01:00
parent 342b490fe7
commit c204aab403
3 changed files with 9 additions and 5 deletions

View File

@@ -48,3 +48,7 @@ See [docs/testing.md](docs/testing.md) for details.
## Documentation Maintenance
**After every code change, update the relevant docs/ file.** Documentation must stay in sync with implementation. When adding a new module, table, tRPC procedure, component, or CLI command, update the corresponding doc. When refactoring, update affected docs and remove stale information.
# Committing
After completing & verifying changes always commit the changes.

View File

@@ -16,8 +16,8 @@ const TOKEN_REFRESH_BUFFER_MS = 300_000; // 5 minutes
export interface OAuthCredentials {
accessToken: string;
refreshToken: string;
expiresAt: number; // ms epoch
refreshToken: string | null;
expiresAt: number | null; // ms epoch, null for setup tokens
subscriptionType: string | null;
rateLimitTier: string | null;
}

View File

@@ -11,9 +11,9 @@
*/
export interface OAuthCredentials {
accessToken: string;
refreshToken: string;
/** Expiry time in milliseconds since epoch */
expiresAt: number;
refreshToken: string | null;
/** Expiry time in milliseconds since epoch. Null for setup tokens with no expiry. */
expiresAt: number | null;
subscriptionType: string | null;
rateLimitTier: string | null;
}