Skip to content

Workflow startup greeting should render client-side, not round-trip through Claude #779

Closed

Description

@jeremyeder

Jira: RHOAIENG-51904

Problem

When a user selects a workflow (e.g., CLAUDE.md Generator), the welcome/greeting message takes 20+ seconds to appear in the chat UI. This is because the startupPrompt from ambient.json is sent through the full LLM round-trip:

runner → backend API → runner /agui/run → Claude SDK → MCP server startup (~14s) → Anthropic API (~3s) → AG-UI events → frontend

The greeting is a static message defined in the workflow's ambient.json. It doesn't need LLM processing.

Root Cause

_trigger_workflow_greeting in ambient_runner/endpoints/workflow.py sends the startupPrompt as a hidden user message to /agui/run, which spins up a full Claude session (including connecting all MCP servers) just to echo back a predetermined message.

Additional bug found during investigation

_trigger_workflow_greeting used path.split("/")[-1] to derive the workflow directory, while clone_workflow_at_runtime uses the repo name (git_url.split("/")[-1].removesuffix(".git")). These don't match, causing the greeting to silently fail — it can't find ambient.json and skips the greeting entirely.

Proposed Solution

  1. Frontend renders the greeting directly: When a workflow is selected, the frontend reads the startupPrompt from the workflow metadata endpoint (/workflow/metadata) and renders it as a system/assistant message in the chat UI immediately — no Claude round-trip needed.

  2. Claude is only invoked when the user sends a real message (e.g., types "1" to select PROJECT/REPO).

  3. Remove _trigger_workflow_greeting from the runner or keep it as a fallback only.

Impact

  • Every workflow activation has a 20+ second delay before the user sees anything
  • Most of that time is MCP server cold starts (google-workspace downloads 80 Python packages via uv on every session start)
  • The greeting itself is static text that could render in <100ms

Time Breakdown (from debug logs)

Phase Duration
mcp-atlassian connect ~1s
webfetch connect (downloads cpython + deps via uv) ~4s
google-workspace connect (downloads 80 packages via uv) ~9s
Anthropic API call ~3s
Total ~20s

Steps to Reproduce

  1. Create a session in the UI
  2. Wait for MCP servers to show as connected
  3. Click a workflow (e.g., CLAUDE.md Generator)
  4. Observe 20+ second delay before greeting appears

Activity

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

    @github-actions
    Contributor

    Amber Change Summary

    The following files were modified:

     components/backend/handlers/sessions.go            | 35 +++++------
     .../components/welcome-experience.tsx              | 22 +++++++
     .../[sessionName]/hooks/use-workflow-management.ts |  9 ++-
     .../[name]/sessions/[sessionName]/lib/types.ts     |  1 +
     .../[name]/sessions/[sessionName]/page.tsx         |  9 ++-
     components/frontend/src/services/api/workflows.ts  |  1 +
     .../ambient_runner/endpoints/workflow.py           | 67 +---------------------
     7 files changed, 59 insertions(+), 85 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 3, 2026

    @github-actions
    Contributor

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

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


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

  4. jeremyeder commented on Apr 11, 2026

    @jeremyeder
    ContributorAuthor

    Closing — implemented in PR #849. Workflow greeting now renders client-side with streaming typewriter effect, no LLM round-trip.

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-fixbugfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions