Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cli/commands/invoke/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ export async function handleInvoke(context: InvokeContext, options: InvokeOption
error: `CUSTOM_JWT agent requires a bearer token. Auto-fetch failed: ${err instanceof Error ? err.message : String(err)}\nProvide one manually with --bearer-token.`,
};
}
} else {
return {
success: false,
error: `Agent '${agentSpec.name}' is configured for CUSTOM_JWT but no bearer token is available.\nEither provide --bearer-token or re-add the agent with --client-id and --client-secret to enable auto-fetch.`,
};
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/cli/tui/screens/invoke/useInvokeFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ export function useInvokeFlow(options: InvokeFlowOptions = {}): InvokeFlowState
// Check if credentials are set up before attempting fetch
const canFetch = await canFetchRuntimeToken(agent.name);
if (!canFetch) {
// No credential configured — silently skip, user can press T to enter manually
setTokenFetchState('error');
setTokenFetchError(
'No OAuth credentials configured for auto-fetch. Press T to enter a bearer token manually, or re-add the agent with --client-id and --client-secret.'
);
return;
}

Expand Down
Loading