You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agentos): liveChatCapable — hide chat-sandbox button for library agents
The chat-sandbox button + landing-chat input on the AgentOS SPA both
trigger `POST /agents/<name>/chat-sandbox`, which proxies to a remote
harness server at `${CA_BASE}/sandboxes`. For agents that run in
their host process (Python `ComputerAgent` harness, etc.) there's no
remote sandbox to proxy to — clicking the button gets a 502 (no
:8787) or a 400 (LIBRARY_AGENT_NO_LIVE_CHAT when source.type =
"library").
This patch adds UI-side gating so the button never renders for these
agents:
routes/agents.ts
- Import `hasResolvableSource`.
- Add a derived `liveChatCapable: sCap && hasResolvableSource(source)`
to each item in `GET /agents` so the SPA can decide without
duplicating server-side logic.
api.ts
- Add `liveChatCapable?: boolean` to the `Agent` interface.
Optional + defaults-true everywhere a value is missing — every
legacy registry doc keeps rendering the button.
App.tsx
- Forward `liveChatCapable={agent.liveChatCapable !== false}` to
`WorkspaceTab`.
WorkspaceTab.tsx
- New `liveChatCapable?: boolean` prop (default `true`).
- Wrap both "New chat" buttons (collapsed + expanded sidebar) in
`{liveChatCapable && (...)}`.
HomePage.tsx
- `resolveTarget()` returns `liveChatCapable` alongside
`sandboxCapable`.
- When the user submits a prompt for a sandbox-capable but
non-live-chat-capable agent, show a friendly inline message
("library-mode agent — invoke from your code") instead of
POSTing to `/chat-sandbox` and surfacing the 400.
Type-check: SPA + agentos-server both compile clean.
0 commit comments