Skip to content

[ark] Multi segment journeys#8138

Merged
paullewis merged 2 commits intobreadboard-ai:mainfrom
paullewis:multi-view
Mar 11, 2026
Merged

[ark] Multi segment journeys#8138
paullewis merged 2 commits intobreadboard-ai:mainfrom
paullewis:multi-view

Conversation

@paullewis
Copy link
Contributor

@paullewis paullewis commented Mar 11, 2026

What

Fixes multi-step journey bugs and adds missing lifecycle states: themed processing indicator, step navigation between segments, a completion view for finished journeys, and graceful error handling with retry for Gemini 503s.

Why

Journeys were broken in several ways: steps didn't advance visually, the step counter went past total ("4 of 3"), the processing spinner was invisible, the last step's emit locked users out, and API errors silently killed the journey.

Changes

Backend (journey_router.py, world_model.py, main.py)

  • Added error_message field to Journey with human-friendly 503/429 messages
  • Capped step counter: min(current_step_index, len(steps))
  • Added retry_journey() — resets a failed journey to planning and re-triggers generation
  • Added POST /journeys/{id}/retry endpoint
  • Wired on_progress callback into _call_agent for real-time agent progress
  • Filtered artifact copying to .jsx/.css only

Frontend (ark-app.ts, journey-store.ts, backend.ts)

  • ViewManager cleanup: null out #viewManager when viewport DOM is removed, fixing step 1→2 transition
  • Completion view: themed panel showing journey objective + accumulated context, with "Done" button
  • Error view: ⚠️ icon + error message + "Retry" button, works both in-flight and from the listing
  • Inspector removed from journey viewport (kept for runs)
  • Spinner theming: processing indicator uses --cg-* tokens, theme CSS injected into shadow DOM via :root:host remap
  • Reuse 404 fixed: added source: "journey" to ViewBundle, inspector skips reuse check for journeys
  • Increased polling timeout to 5 minutes
  • Completed/errored journeys are reopenable from the listing

Types (types.ts)

  • Added source?: "run" | "journey" to ViewBundle

Testing

  1. Start a new journey — spinner should show with theme-aware colors and real-time progress text
  2. Complete all steps — completion view should show accumulated context with "Done" button
  3. Reopen a completed journey from the listing — should show the completion view
  4. Kill the backend mid-generation or wait for a 503 — error view should appear with "Retry" button
  5. Click Retry — should reset and re-trigger generation
  6. Switch themes during processing — spinner should follow the active theme

@paullewis paullewis enabled auto-merge (squash) March 11, 2026 18:18
@paullewis paullewis merged commit e7bed0c into breadboard-ai:main Mar 11, 2026
3 checks passed
@github-actions
Copy link

📊 Coverage Report

Metric PR Main Delta
Lines 98.30% 98.30% ⚪ +0.00%
Functions 98.25% 98.25% ⚪ +0.00%
Branches 94.17% 94.17% ⚪ +0.00%

@paullewis paullewis deleted the multi-view branch March 12, 2026 09:29
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