eyaltoledano/claude-task-master · error
AUTH_REQUIRED
AUTH_REQUIRED
Error message
Authentication required
What it means
getBriefStatus() first checks authManager.hasValidSession(); if there is no valid authenticated session, it short-circuits and returns a structured failure with code AUTH_REQUIRED and message 'Authentication required'. The API call is never attempted — this is a client-side preflight check, so the user needs to log in before polling brief status.
Source
Thrown at packages/tm-core/src/modules/integration/services/export.service.ts:1354
message: `Failed to connect to API: ${errorMessage}`
}
};
}
}
// ========== Brief Status Polling ==========
/**
* Get the current status of a brief's task generation
* Used to poll progress after generateBriefFromPrd
*/
async getBriefStatus(briefId: string): Promise<BriefStatusResult> {
const isAuthenticated = await this.authManager.hasValidSession();
if (!isAuthenticated) {
return {
success: false,
error: {
code: 'AUTH_REQUIRED',
message: 'Authentication required'
}
};
}
// Get API URL
const authDomain = new AuthDomain();
const apiBaseUrl = authDomain.getApiBaseUrl();
if (!apiBaseUrl) {
return {
success: false,
error: {
code: 'MISSING_CONFIGURATION',
message: 'API endpoint not configured'
}
};
}View on GitHub (pinned to c0c98d367c)
Solutions
- Run the login flow (e.g. 'tm auth') to establish a valid session, then retry getBriefStatus.
- Check hasValidSession() before calling and route the user to authentication if false.
- If the session recently expired, re-authenticate — tokens are not auto-refreshed here.
- Verify the auth config/storage location is intact and points at the expected profile.
Example fix
// before
const res = await tmCore.integration.getBriefStatus(briefId); // fails when logged out
// after: preflight the session
if (!(await tmCore.auth.hasValidSession())) {
await tmCore.auth.login(); // or prompt the user to run 'tm auth'
}
const res = await tmCore.integration.getBriefStatus(briefId); Defensive patterns
Strategy: validation
Validate before calling
if (!(await tmCore.auth.hasValidSession())) {
throw new Error('Not logged in. Run tm auth before polling brief status.');
} Type guard
function isAuthRequired(result: { success: boolean; error?: { code: string } }): boolean {
return !result.success && result.error?.code === 'AUTH_REQUIRED';
} Try / catch
const res = await tmCore.integration.getBriefStatus(briefId);
if (!res.success && res.error?.code === 'AUTH_REQUIRED') {
await tmCore.auth.login(); // re-authenticate then retry
} Prevention
- Always check hasValidSession() before any authenticated API call
- Run the login flow as part of environment/CI setup
- Handle session expiry proactively (refresh or re-login on AUTH_REQUIRED)
- Keep auth config/storage intact; avoid partial logout implementations
When it happens
Trigger: Calling getBriefStatus(briefId) while logged out: no session exists, the stored session expired and is no longer valid, credentials were cleared from config, or the app is running in an environment without prior 'tm auth' login.
Common situations: Session token expired after idle time; CI/CD or fresh machine where authentication was never performed; user logged out in another terminal; corrupted or deleted local auth/config storage.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- MCP Provider requires active MCP session
- NOT_AUTHENTICATED
- REFRESH_FAILED
- REFRESH_FAILED
- SESSION_SET_FAILED
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/393a2b4d466c1c83.
Report an issue: GitHub.