-
Notifications
You must be signed in to change notification settings - Fork 70
Feature/oauth confirmation #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eLysgaard
merged 7 commits into
databricks:main
from
eLysgaard:feature/auth-confirmation
Jan 19, 2026
Merged
Feature/oauth confirmation #84
eLysgaard
merged 7 commits into
databricks:main
from
eLysgaard:feature/auth-confirmation
Jan 19, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When an agent tool call fails due to missing OAuth credentials, the chat now displays a friendly inline UI instead of a raw error. Users can click to open the OAuth login page, then retry the failed tool call without losing context. - Add oauth-error-utils.ts for detecting and parsing credential errors - Add MessageOAuthError component with Login/Retry buttons - Update message.tsx to render OAuth errors inline (not in error list) - Add tool-call schema support for retry with pending tool calls - Skip stream resume when OAuth errors are detected 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add unit tests for oauth-error-utils.ts (22 tests) - isCredentialErrorMessage detection - findLoginURLFromCredentialErrorMessage extraction - findConnectionNameFromCredentialErrorMessage extraction - Integration tests for full error parsing - Add E2E tests for OAuth error UI components (4 tests) - Pattern detection in browser context - UI rendering verification - Add OAuth error fixtures for test mocking - Update Playwright config with 'oauth' test project 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The previous approach tried to include tool-call parts in the user message, but the backend converter only handles tool-calls in assistant messages. Instead, we now simply resend the original user text message and let the agent make the tool call again. Since the user is now authenticated after clicking Login, the tool call should succeed on retry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The spec requires sending both the user message and the failed tool call
when retrying after OAuth authentication. This commit:
- Updates responses-convert-to-input.ts to handle tool-call parts in
user messages by converting them to function_call items in the input
- Restores the frontend logic to include tool-call parts in retry message
- Re-adds tool-call schema to allow tool calls in user message parts
The backend now correctly converts:
{ role: "user", parts: [text, tool-call] }
Into the Databricks API format:
[{ role: "user", content: [...] }, { type: "function_call", ... }]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Resolved conflicts in: - client/src/components/chat.tsx (keep both clearError and addToolResult/regenerate) - client/src/components/message.tsx (keep deleteTrailingMessages and MCP approval imports) - client/src/components/messages.tsx (removed duplicate sendMessage prop)
- Move OAuth retry logic from message.tsx into MessageOAuthError - MessageOAuthError now extracts loginUrl and connectionName internally - Simplify message.tsx by removing OAuth-specific logic - Clean up unused imports (findLoginURLFromCredentialErrorMessage, findConnectionNameFromCredentialErrorMessage, deleteTrailingMessages) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Revert responses-convert-to-input.ts to upstream main (remove OAuth retry flow changes from user message handling) - Apply Biome formatting to chat.tsx and message.tsx (quote style) Co-Authored-By: Claude Opus 4.5 <[email protected]>
bbqiu
approved these changes
Jan 17, 2026
Contributor
bbqiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks for working on this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds OAuth confirmation UI that prompts users to authenticate when tool calls encounter credential errors, with login and retry functionality.
Tested using https://eng-ml-inference.staging.cloud.databricks.com/ml/endpoints/agents_main-bbqiu-oauth?o=1653573648247579. Also added unit tests to cover new behavior.
chatbot-oauth-confirmation-demo.mov