Agents Builders

Live activities via websockets

Archived
live-activities-via-websockets

Created

Jul 06, 01:19

Started

Jul 06, 01:20

Completed

Jul 06, 05:02

DevOps handoff

Type

Feature

Shape

ui+db

Worktree Slug

live-activities-via-websockets

Repositories

mcritchie-studio

Release Slug

Branch

feat/live-activities-via-websockets

QA URL

Production URL

ui

Acceptance Criteria

  • Activity create broadcasts and prepends to feed live
  • Activity update broadcasts and replaces its row live
  • Action create broadcasts into its activity drill-down
  • Action update broadcasts and replaces its action row
  • Updated activity or action flashes briefly on change
  • Websocket additive; pagination count not maintained

Expected Test Plan

  • [integration] activity/action create+update broadcast turbo streams
  • [integration] /agents/activities subscribes via turbo_stream_from
  • [component] the live activity + action turbo-stream partials render

Checks Run

  • [unit] ActivitiesBroadcaster SEV-1 safe_broadcast guard + both model commit callbacks wired
  • [integration] activity/action create+update broadcast correct turbo-stream action/target/content
  • [integration] /agents/activities subscribes via turbo_stream_from + rows carry stable dom ids
  • [component] _activity_row tbody + _activity_action_row render with ids; table renders extracted partial
  • [e2e] Playwright: API-triggered activity insert + close-update + action append patch the open page live (async cable) — 2 specs green
  • [full-suite@a60aada3250d16bb060a8233029511235694191e] bin/rails test green
  • [rubocop@a60aada3250d16bb060a8233029511235694191e] bin/rubocop clean

Agent Context

Add live websocket updates to /agents/activities (AgentsController#activities, shipped in #405, now on release). Requirements: (1) AgentActivity created -> prepend its row (tbody) to the top of the feed (newest-first). (2) AgentActivity updated -> replace that activity's tbody in place. (3) AgentAction created -> append its action row into its parent activity's drill-down (if that activity is on the page). (4) AgentAction updated -> replace that action row. (5) A brief flash animation when an activity OR action is UPDATED (not necessarily on create). Operator: do NOT try to maintain the 10-per-page pagination count on live inserts — the websocket is purely ADDITIVE (new items just get added; page can exceed 10 live). Follow the app's existing live-update pattern: /deployments uses Turbo Stream broadcasts + LiveBoardFx JS for animations (see feedback_live_board_animation_gotchas, feedback_live_partial_dual_render_paths). Use turbo-rails Turbo::Streams broadcasts from the AgentActivity/AgentAction models (after_create_commit / after_update_commit) targeting a stream the page subscribes to via turbo_stream_from. Reuse the existing agents/_activities_table row partials so the broadcast renders the SAME markup (dual render paths must match). Flash = a short CSS keyframe on the replaced row. Mind table/tbody Turbo Stream targeting (templates + table elements are finicky). Shape ui+db (model broadcast callbacks + UI subscription). Tests: model broadcast on create/update, view subscribes, partial renders.

Stage Timeline

Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. means the agent didn't report that metric.

Sizing Avi · PO MEDIUM Dev MEDIUM Actual XL ≠ forecast
  1. Created Designed
    T Tyrogue
    Tyrogue
    Model
    Duration
    Tokens
    Cost
    Completed Jul 06, 01:19 · 2 days ago
    api
  2. Designed Building
    T Tyrogue
    Tyrogue
    Model
    claude-opus-4-8
    Duration
    under a minute
    Tokens
    3,757,664
    Cost
    ~$2.75
    Started Jul 06, 01:19
    Completed Jul 06, 01:20 · 2 days ago
    cli
  3. Building Submitted
    T Tyrogue
    Tyrogue
    Model
    claude-opus-4-8
    Duration
    43 minutes
    Tokens
    73,461,600
    Cost
    ~$43.78
    Started Jul 06, 01:20
    Completed Jul 06, 02:03 · 2 days ago
    cli
  4. Submitted Reviewed Review Activity
    C Carl
    Carl primary
    S Shannon
    Shannon light
    Model
    claude-opus-4-8
    Duration
    6 minutes
    Tokens
    14,977,839
    Cost
    ~$8.45
    Started Jul 06, 02:03
    Completed Jul 06, 02:09 · 2 days ago
    cli
  5. Evolve
    T Tyrogue
    Tyrogue
    H Hitmonchan
    Hitmonchan
    triggered by
    C Carl
    Carl
    Model
    Duration
    6 minutes
    Tokens
    Cost
    Started Jul 06, 02:03
    Completed Jul 06, 02:09 · 2 days ago
  6. Reviewed Assembled
    D
    d160c590-98d5-4501-b64c-6d378417235e
    Model
    claude-opus-4-8
    Duration
    under a minute
    Tokens
    Cost
    Started Jul 06, 02:09
    Completed Jul 06, 02:09 · 2 days ago
    cli
  7. Assembled Shipped
    A Avi
    Avi
    Model
    claude-opus-4-8
    Duration
    about 3 hours
    Tokens
    Cost
    Started Jul 06, 02:09
    Completed Jul 06, 05:02 · 2 days ago
  8. Shipped Archived
    Model
    Duration
    about 11 hours
    Tokens
    Cost
    Started Jul 06, 05:02
    Completed Jul 06, 15:43 · 2 days ago

Conversation

QA review feedback, agent handoffs, and follow-up notes for this task.

Comment carl 2 days ago

Scout report: request-changes - Boundary close path skips the live activity update broadcast. Reporter: carl Outcome: request-changes Findings: - Blocker: bin/agent-activity next sends prior_outcome through the create endpoint, but AgentActivity.open_activity! closes the previous row with update_all, bypassing the after_update_commit broadcaster; the previous activity can stay open on the live feed and never flash. Questions: - The page subscribes to a global agents_activities stream even when session filters are active; confirm additive out-of-filter inserts are acceptable or scope/drop them client-side. Checks: - Read AGENTS.md, Avi pr-review SOP, shared pr-review SOP, README, RUNBOOK, ECOSYSTEM, and relevant frontend/testing/routes/data-model docs. - Inspected PR #412 body, diff, changed files, tests, and task metadata; acceptance explicitly requires activity updates to replace rows live and flash. - GitHub reports PR #412 merged to release at 85c8c50 with scan_ruby, scan_js, lint, and test all passing. - Merge safety: changed files are activity-feed/broadcaster/test scoped, and open release PRs #379, #363, and #361 do not overlap these files.

Comment shannon 2 days ago

Scout report: merge-ready - Light UI review: live Turbo stream path matches the acceptance criteria; no blocking defects found. PR #412 was already merged and the task assembled before this scout report. Reporter: shannon Outcome: merge-ready Findings: - No blocking UI defects found in the activity/action create-update stream path. - Non-blocker follow-up: the global agents_activities stream can insert new activities into filtered or older pages because the activity insert target is page-global; acceptable for this additive scope, but revisit if filtered live views must stay strict. - Process note: DoR now refuses the PR only because #412 is already merged; the recorded full-suite/rubocop fingerprint matches the PR head tree. Questions: - none Checks: - Read AGENTS.md, Avi pr-review SOP, shared PR-review module, README, ECOSYSTEM, frontend/testing/routes docs, and Shannon role/soul. - Reviewed task metadata, PR body, diff, changed files, CI, DoR state, and open-PR overlap; no same-file merge conflict risk found. - Focused Rails check passed: bin/rails test test/services/activities_broadcaster_test.rb test/integration/agents_activities_test.rb (22 runs, 98 assertions). - Local URL http://localhost:3014/agents/activities returned 200 and rendered the Turbo subscription plus stable activity/action DOM ids.

Handoff avi 2 days ago

Avi pr-review verdicts landed after operator merge (PR #412 merged to release by amcritchie 02:08:45Z, task assembled mid-wave). Primary carl: request-changes — open_activity! update_all bypasses after_update_commit broadcaster, prior row never updates live. Light shannon: merge-ready, no blockers. Not dragging assembled work back; defect filed as follow-up bug task fix-boundary-close-broadcast (https://mcritchie.studio/tasks/fix-boundary-close-broadcast). Rides current release as-is.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

MEDIUM

Dev

MEDIUM

Actual

XL