Skip to content

run_tool - Clarify Glean is already authenticated on connector AUTH_REQUIRED#17

Draft
eshwar-sundar-glean wants to merge 2 commits into
mainfrom
eshwar/connector-auth-suffix
Draft

run_tool - Clarify Glean is already authenticated on connector AUTH_REQUIRED#17
eshwar-sundar-glean wants to merge 2 commits into
mainfrom
eshwar/connector-auth-suffix

Conversation

@eshwar-sundar-glean

@eshwar-sundar-glean eshwar-sundar-glean commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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 with authUrls), append a short clarification
text block:

Note: Glean itself is already authenticated. This is a downstream
connector/tool authorization request — NOT [SETUP_REQUIRED]. Do not call the
setup tool. Have the user authorize using the link above, then retry this
tool.

This stops the model from confusing connector auth with the plugin's own
[SETUP_REQUIRED] (Glean sign-in) and wrongly calling setup.

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.
@eshwar-sundar-glean eshwar-sundar-glean changed the title Clarify Glean is already authenticated on connector AUTH_REQUIRED (suffix only) run_tool - Clarify Glean is already authenticated on connector AUTH_REQUIRED Jun 20, 2026
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.
Comment thread src/tools/run-tool.ts
// 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 " +

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eshwar-sundar-glean eshwar-sundar-glean marked this pull request as draft June 20, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant