Skip to content

fix(workflow): render startup greeting client-side with race condition fixes#849

Open
jeremyeder wants to merge 1 commit intoambient-code:mainfrom
jeremyeder:fix/workflow-startup-combined
Open

fix(workflow): render startup greeting client-side with race condition fixes#849
jeremyeder wants to merge 1 commit intoambient-code:mainfrom
jeremyeder:fix/workflow-startup-combined

Conversation

@jeremyeder
Copy link
Contributor

Summary

Combines PR #780 and PR #846 into a single PR:

  • Backend: Add startupPrompt field to OOTBWorkflow struct and parse it from ambient.json in workflow repos
  • Frontend: Render workflow startup greeting client-side instead of round-tripping through Claude, fixing stale greeting and race conditions
  • Runner: Remove server-side greeting logic (no longer needed with client-side approach)
  • Tests: Add vitest regression tests for stale greeting bug in use-workflow-management

What was broken

When a user clicked a workflow tile (e.g. "PRD RFE Workflow"), the workflow activated successfully but:

  1. The startupPrompt from ambient.json was never served by the OOTB endpoint (missing field)
  2. No greeting was displayed to guide the user on next steps
  3. The session appeared to do nothing after activation

Test plan

  • Click a workflow tile on a Running session — verify greeting appears
  • Switch between workflows — verify greeting updates (no stale state)
  • Select workflow on a non-Running session — verify it queues and activates when Running
  • Run cd components/frontend && npx vitest run — verify regression tests pass

Supersedes #780 and #846.

🤖 Generated with Claude Code

…ode#780 + ambient-code#846)

Replaces the server-side workflow greeting round-trip with a client-side
approach that provides instant feedback when users select a workflow.

Backend:
- Add `startupPrompt` and `greeting` fields to OOTBWorkflow struct
- Parse both fields from ambient.json in workflow repos

Frontend:
- Display `greeting` text with typewriter streaming effect below tiles
- Add `hidden` option to sendMessage for system-initiated messages
- Remove 3-second hardcoded sleep after workflow activation
- Remove server-side workflowGreeting state (no LLM round-trip needed)

Runner:
- Remove server-side greeting trigger logic (no longer needed)
- Clean up unused imports (aiohttp, uuid, load_ambient_config)

Tests:
- Add vitest regression tests for stale greeting and race conditions
- Add vitest.config.ts for frontend unit testing

Companion: ambient-code/workflows#61 (ambient.json fixes)

Supersedes ambient-code#780 and ambient-code#846.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder force-pushed the fix/workflow-startup-combined branch from 0f975c2 to 3a5266a Compare March 9, 2026 02:54
@ambient-code
Copy link
Contributor

ambient-code bot commented Mar 11, 2026

Review Queue — Blockers Found

Check Status Detail
CI pass
Merge conflicts FAIL Has merge conflicts
Review comments pass
Jira hygiene warn No Jira reference found
Fork PR warn Fork (jeremyeder) — no automated agent review
Staleness pass

This comment is auto-generated by the Review Queue workflow and will be updated when the PR changes.

@ambient-code ambient-code bot modified the milestones: Merge Queue, Review Queue Mar 12, 2026
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