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.
feat(capabilities): multi-credential support for capability delegation #328
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
Uh oh!
There was an error while loading. Please reload this page.
feat(capabilities): multi-credential support for capability delegation #328
Changes from all commits
94816e194429614405f09c92e68f0cc0c9e95b068b71eb2ed3a96be5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
Reject unknown credential selections instead of silently falling back.
If
use-capabilitygets a stale or hallucinated ID, this loop just skips it and the sub-agent runs with whatever credential was already inthis.params.credentials. That makes the tool call look successful while operating on the wrong account. Return an error when a requested(credType, id)pair is missing fromcredentialPool.Suggested fix
const credentialOverrides = input.credentials as | Record<string, number> | undefined; @@ const subAgentCredentials = this.params.credentials ? { ...this.params.credentials } : undefined; + const invalidOverrides: string[] = []; if ( credentialOverrides && this.params.credentialPool && subAgentCredentials ) { for (const [credType, credId] of Object.entries( credentialOverrides )) { const pool = this.params.credentialPool[credType as CredentialType]; const match = pool?.find((c) => c.id === credId); - if (match) { - subAgentCredentials[credType as CredentialType] = match.value; - } + if (!match) { + invalidOverrides.push(`${credType}:${credId}`); + continue; + } + subAgentCredentials[credType as CredentialType] = match.value; } } + if (invalidOverrides.length > 0) { + return { + success: false, + error: `Unknown credential selection(s): ${invalidOverrides.join(', ')}`, + }; + }Also applies to: 1694-1721
🤖 Prompt for AI Agents
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.
use-capabilitycannot consume this newcredentialsargument yet.This prompt now tells the model to pass
credentials: { ... }, but the providedpackages/bubble-core/src/bubbles/service-bubble/ai-agent.ts:1437-1900snippet still exposesuse-capabilitywith onlycapabilityIdandtask, and forwards only those two fields tohandleUseCability(...). The selection data will be dropped, so pooled credentials still fall back to the default account.🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
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.
Don’t require
get_capabilitiesuntil the tool exists.The same
initializeTools()snippet does not register anyget_capabilitiestool, so this new hard rule pushes the model toward a nonexistent call path whenever users ask capability-feature questions.🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.