fix: show all agents in command select, disable those without active session

Previously the agent select in the OrchestrationBar only listed agents
with a session_key set (agents.filter(a => a.session_key)), causing the
dropdown to appear completely empty when agents exist but none have an
active session. This was confusing — users thought no agents were
registered.

Fix: show all registered agents in the dropdown. Agents without an
active session_key are shown as disabled with a '— no session' suffix
and a tooltip explaining why they can't be messaged. The 'No agents
registered' placeholder is shown only when the agents array is truly
empty.

The send button remains correctly disabled when no valid agent is
selected.

Fixes #321
This commit is contained in:
HonzysClawdbot 2026-03-14 10:38:53 +01:00 committed by GitHub
parent 176e862431
commit 4fa1cbd3a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -1830,6 +1830,8 @@
"tabPipelines": "Pipelines", "tabPipelines": "Pipelines",
"tabFleet": "Fleet", "tabFleet": "Fleet",
"selectAgent": "Select agent...", "selectAgent": "Select agent...",
"noAgentsRegistered": "No agents registered",
"noSessionSuffix": "no session",
"commandPlaceholder": "Send command or message to agent...", "commandPlaceholder": "Send command or message to agent...",
"send": "Send", "send": "Send",
"noTemplates": "No workflow templates yet", "noTemplates": "No workflow templates yet",

View File

@ -268,9 +268,12 @@ export function OrchestrationBar() {
className="h-9 px-2 rounded-md bg-secondary border border-border text-sm text-foreground min-w-[140px]" className="h-9 px-2 rounded-md bg-secondary border border-border text-sm text-foreground min-w-[140px]"
> >
<option value="">{t('selectAgent')}</option> <option value="">{t('selectAgent')}</option>
{agents.filter(a => a.session_key).map(a => ( {agents.length === 0 && (
<option key={a.name} value={a.name}> <option value="" disabled>{t('noAgentsRegistered')}</option>
{a.name} ({a.status}) )}
{agents.map(a => (
<option key={a.name} value={a.name} disabled={!a.session_key} title={!a.session_key ? 'Agent has no active session' : undefined}>
{a.name} ({a.status}){!a.session_key ? `${t('noSessionSuffix')}` : ''}
</option> </option>
))} ))}
</select> </select>