run_tool - Clarify Glean is already authenticated on connector AUTH_REQUIRED#17
Draft
eshwar-sundar-glean wants to merge 2 commits into
Draft
run_tool - Clarify Glean is already authenticated on connector AUTH_REQUIRED#17eshwar-sundar-glean wants to merge 2 commits into
eshwar-sundar-glean wants to merge 2 commits into
Conversation
When run_tool returns a downstream connector AUTH_REQUIRED result (isError + authUrls JSON envelope), append a clarification text block: Glean itself is already authenticated and this is NOT [SETUP_REQUIRED], so the model must not call `setup`. The gateway's original content (including the link) is left untouched — no dialog, no link reformatting; only the suffix is added. Bump plugin manifests to 0.2.27.
The previous suffix leaked internals into the user-facing message (the model relayed 'Glean is already authenticated...'). Reframe it as a terse instruction to the assistant: ask the user only to authorize via the link, do not mention Glean/connectors/setup or any auth internals, and do not call setup.
| // AUTH_REQUIRED result: keep the user-facing ask minimal and don't leak auth | ||
| // internals, while still preventing a wrong `setup` call. | ||
| const CONNECTOR_AUTH_SUFFIX = | ||
| "Assistant: ask the user only to authorize using the link above. Do not " + |
Collaborator
Author
There was a problem hiding this comment.
Without giving a prompt like this, the LLM keeps saying stuff like
I won't call setup,
We already authenticated to Glean, now connectors
etc.
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
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.
Summary
Minimal, prompt-only handling of downstream connector authorization in
run_tool. When the Glean gateway returns a connector AUTH_REQUIRED result(
isError+ a JSON envelope withauthUrls), append a short clarificationtext block:
This stops the model from confusing connector auth with the plugin's own
[SETUP_REQUIRED](Glean sign-in) and wrongly callingsetup.