feat(dojo): support Authorization header for the agno integration#2132
Open
Himanshu040604 wants to merge 2 commits into
Open
feat(dojo): support Authorization header for the agno integration#2132Himanshu040604 wants to merge 2 commits into
Himanshu040604 wants to merge 2 commits into
Conversation
Agno v2.7 can place its AG-UI endpoint behind AgentOS auth middleware, so secured backends reject the dojo's anonymous requests. Add an opt-in AGNO_AUTH_TOKEN env var: when set, the dojo's AgnoAgent instances send Authorization: Bearer <token>; when unset, behavior is unchanged. Fixes ag-ui-protocol#2130
There was a problem hiding this comment.
Pull request overview
Adds optional auth-token plumbing to the Dojo’s Agno integration so the Dojo can connect to secured Agno/AgentOS deployments by sending a Bearer Authorization header on all Dojo→Agno requests when configured.
Changes:
- Introduces
AGNO_AUTH_TOKENin Dojo env parsing with an empty-string default (no-op when unset). - Passes
Authorization: Bearer <token>viaAgnoAgent/HttpAgentheadersconfig only when the token is set. - Documents the Dojo auth env var in the
@ag-ui/agnoTypeScript README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| integrations/agno/typescript/README.md | Documents AGNO_AUTH_TOKEN usage for running Dojo against secured Agno/AgentOS. |
| apps/dojo/src/env.ts | Adds agnoAuthToken to Dojo env var parsing with a safe default. |
| apps/dojo/src/agents.ts | Conditionally injects an Authorization header into AgnoAgent construction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Dojo | ||
|
|
||
| To run the [dojo](https://github.com/ag-ui-protocol/ag-ui/tree/main/apps/dojo) against a secured AgentOS (e.g. `OS_SECURITY_KEY`, JWT middleware, or platform access tokens), set `AGNO_AUTH_TOKEN` — every agno request will then carry an `Authorization: Bearer` header: |
Spell out the full Authorization: Bearer <token> value in the dojo note so the literal 'Bearer' string isn't read as the header value. Addresses Copilot review feedback on ag-ui-protocol#2132.
1 task
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.
What
Adds an opt-in
AGNO_AUTH_TOKENenv var to the dojo's agno integration. When set, every dojo→agno request carriesAuthorization: Bearer <token>. When unset, behavior is byte-identical to today.Fixes #2130
Why
Agno v2.7 (agno-agi/agno#8747) put agno's AG-UI endpoint behind AgentOS's central auth middleware, so deployments using
OS_SECURITY_KEY, JWT auth, or platform access tokens now return401to anonymous requests. The dojo builds itsAgnoAgentinstances fromAGNO_URLalone — there is no way to attach a credential — which means the stock dojo cannot connect to any secured agno backend. This PR closes that gap with a single opt-in env var, while unsecured setups keep working exactly as before.We chose this approach because the SDK already supports it end-to-end — no new machinery needed (agno#8747 review):
Design
env.tswith an|| ""default, consumed in theagents.tsfactory.HttpAgentalready sends configuredheaderson every request;@ag-ui/agnostays a thin subclass.agents.tsisserver-onlyand the var is notNEXT_PUBLIC_-prefixed, so the token never reaches the browser.Testing
No sidebar feature is added, so no new e2e suite per CONTRIBUTING. Verified instead (Node 22, pnpm 10.33.4):
pnpm run build(nx, 34 projects)pnpm generate-content-json+git diff --exit-code src/files.jsonpnpm run test@ag-ui/cross-language-tests, which needs a local .NET SDK and fails identically on unmodified maintests/agnoTests, 10 tests) withAGNO_AUTH_TOKENunsetLive against agno v2.7.0:
OS_SECURITY_KEYsetHTTP 401 {"detail":"Authorization header required"}OS_SECURITY_KEYsetAGNO_AUTH_TOKENset