Skip to content

feat(studio): X02b serve card on the Code tab - #1118

Merged
LinuxDevil merged 4 commits into
mainfrom
fb-x02b-serve-card
Nov 14, 2026
Merged

LinuxDevil merged 4 commits into
mainfrom
fb-x02b-serve-card

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • ServeCard on the Code tab (/agents/:id/code): enable/disable /serve/<id> for the published version, masked token with Reveal (30 s, memory only) / Rotate, allowed-origins editor, and a curl snippet that uses $LOUSHO_SERVE_TOKEN — never the real bearer.
  • useServeStatus hook: GET /agents/:id/serve on mount + live refresh on agent.changed version/meta events.
  • Stacks on feat(studio): X02a serve published agents over HTTP #1117 (X02a serve routes).

Test plan

  • ServeCard.test.tsx — 14 tests: loading/error/retry, unpublished + disabled states, toggle, reveal/auto-hide, rotate toast, origins save + 400, clipboard success/failure, event refresh
  • CodeTab.test.tsx — updated mocks, 9 tests green
  • typecheck + lint + fallow clean

Generated with Devin

LinuxDevil and others added 3 commits November 13, 2026 03:53
/serve/<id>/* answers the SDK's whole chat API for the agent's pinned
published version: a Studio-global serve.json holds the per-agent
{enabled, token, allowedOrigins} switch, the Express<->Fetch bridge
streams raw bodies (mounted before express.json), and the SDK
createRouteHandler enforces the per-agent bearer + origin rules.
Handlers cache per published version and rebuild on a moved pointer;
rotating the token drops the cached handler so the old bearer dies.
Sessions persist under .lousho/agents/<id>/serve-sessions via a new
sessions slot on StudioRunDeps.

Management routes GET/PUT /agents/:id/serve, GET .../serve/token and
POST .../serve/rotate-token ride the studio-token /agents gate; /serve
itself is host-only at the global middleware and stays out of
API_PREFIXES, the SPA fallback and the Vite proxy.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The X02a serve-surface wiring pushed createApp's cognitive complexity
to 17 (gate: 15). Store/service construction moves into
createStudioStores + createAuthorRunner; createApp is now a flat list of
register* calls. No behavior change.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ServeCard loads GET /agents/:id/serve, toggles serving through PUT,
reveals/copies/rotates the bearer (memory only, 30 s reveal), edits
allowed origins one-per-line and shows a curl snippet with
$LOUSHO_SERVE_TOKEN. Refreshes on agent.changed version/meta events.
Mounted at the bottom of the Code tab.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil changed the base branch from fb-x02a-serve-http to main November 14, 2026 13:21
# Conflicts:
#	apps/agent-forge/server/app.ts
#	apps/agent-forge/src/runtime/__tests__/runtimeClient.test.ts
@LinuxDevil
LinuxDevil merged commit 1577ece into main Nov 14, 2026
6 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