Skip to content

feat(public-api): add /v1/sessions/:id/runs endpoint for AG-UI prompt delivery #753

@jeremyeder

Description

@jeremyeder

Problem

The public API has no endpoint for sending prompts to a running session. The only way to deliver a prompt to a runner is:

  1. Through the frontend's backend proxy at /api/projects/:name/agentic-sessions/:id/agui/run
  2. Directly to the runner pod on port 8001 via port-forward or in-cluster access

Option 1 requires a browser. Option 2 bypasses the UI entirely — the frontend never sees the AG-UI event stream, so work happens invisibly.

Impact

  • The MCP server (ambient-code/mcp) and CLI (acpctl) cannot send prompts to sessions through any API
  • The acp-compile workflow (submit a plan for autonomous execution) has no proper delivery mechanism
  • Direct pod access creates invisible work that the UI can't display

Proposed Solution

Add POST /v1/sessions/:id/runs to the public API that proxies to the runner's AG-UI endpoint, similar to how the backend already proxies at /api/projects/:name/agentic-sessions/:id/agui/run.

This enables:

  • MCP server to send prompts via API
  • CLI to submit work via acpctl
  • Any API client to interact with sessions

The endpoint should:

  • Accept the same AG-UI RunAgentInput JSON body the runner expects
  • Stream SSE events back to the caller
  • Require the same auth (Bearer token + X-Ambient-Project header)

Context

Discovered while trying to use the acp-compile skill to submit a plan to a running session on a kind cluster. The only way to deliver the prompt was curl directly to the pod, which cut the UI out completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    amber:auto-fixAmber agent: automated low-risk fixes (formatting, linting)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions