Skip to content

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

Closed as not planned

Description

@jeremyeder

Jira: RHOAIENG-51908

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.

Activity

  1. added
    ambient-code:auto-fix
    on Mar 1, 2026
  2. github-actions commented on Mar 1, 2026

    @github-actions
    Contributor

    Amber Change Summary

    The following files were modified:

     components/public-api/handlers/integration_test.go | 151 +++++++++++++++++++++
     components/public-api/handlers/middleware.go       |   7 +-
     components/public-api/handlers/sessions.go         |  74 ++++++++++
     components/public-api/main.go                      |   7 +-
     components/public-api/types/dto.go                 |  11 ++
     5 files changed, 245 insertions(+), 5 deletions(-)
    
    

    Next Steps:

    • Review that changes match the issue description
    • Verify no scope creep or unintended modifications
    • A PR will be created shortly for formal review

    🔍 View AI decision process (logs available for 90 days)

  3. github-actions commented on Mar 1, 2026

    @github-actions
    Contributor

    🤖 Amber has created a pull request to address this issue: #755

    The changes are ready for review. All automated checks will run on the PR.


    🔍 View AI decision process (logs available for 90 days)

  4. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    Inactive for 30 days. Will close in 7 days unless there's activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ambient-code:auto-fixstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions