Skip to content

[ADD] ui: expose the current user's agents to templates - #196

Merged
beorngb merged 1 commit into
mainfrom
fix/user-agents-jinja-global
Aug 28, 2026
Merged

[ADD] ui: expose the current user's agents to templates#196
beorngb merged 1 commit into
mainfrom
fix/user-agents-jinja-global

Conversation

@beorngb

@beorngb beorngb commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

A sidebar that lists the current user's agents is drawn on every /me page, but
only the chat route builds that list — so on workflows, connections, dashboard,
tools and vault it rendered empty, reading as "no agents available" to anyone
whose theme shows it.

It stayed hidden because the two conditions rarely meet: superadmins bypass the
per-user check entirely, and the one page that does pass the list is the one
most used. It surfaces for a non-superadmin on any other page.

user_agents(request) lets a template ask for the list wherever it is drawn,
instead of every route having to carry it — including routes in plugins mounted
from elsewhere, which cannot be changed from here. The import is lazy because
ui.routes.me imports this module, and it returns an empty list rather than
raising when there is no session, so a template can call it unguarded.

Nothing in this repository consumes it yet; the core pages keep passing their
own context and behave exactly as before.

A sidebar is drawn on every /me page, but only the chat route builds the agent
list, so every other page rendered it empty — reading as "no agents available"
to anyone whose theme shows that list. Superadmins were unaffected on the chat
page and so nobody noticed.

A template can now ask for the list wherever it is drawn instead of each route
having to carry it. The lookup is lazy and returns nothing rather than raising
when there is no session, so a template can call it unguarded.
@beorngb
beorngb merged commit e684d89 into main Aug 28, 2026
8 checks passed
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