e4a1c20fc2
Both panels were empty on Connect / agent select — only new events since
subscribe appeared. Backend already persists per-agent logs to
logs/<id>/YYYY-MM-DD.jsonl AND now keeps the last 100 status diffs in
a ring buffer (agents_and_robots 71b3b2b).
Frontend changes:
- fetch_log_history(s, agent_id, n) → GET /agents/{id}/logs?n=N, fills
s.log_lines BEFORE SSE subscribe so context appears instantly.
Handles the {count,id,lines:[...]} response shape from the backend.
- start_log_sse now spawns this fetch on entry; SSE adds new lines on top.
- fetch_status_history(s, n) → GET /status/recent?n=N, fills
s.status_events with [hist]-tagged entries before the live SSE attaches.
- Connect handler dispatches fetch_status_history() in a worker thread
alongside the existing start_status_sse + fetch_agents_async.
E2E (4 new, 29 total):
- test_status_recent_history_endpoint — shape contract
- test_status_recent_captures_stop_start_events — drives stop/start on
test-bot, asserts events appear in /status/recent within 5s. This is
the "send actions and observe feed" loop the user requested.
- test_agent_logs_history_endpoint — {count,id,lines} contract +
lines>0 for long-running assistant-bot
- test_status_recent_unauthorized_without_bearer — auth boundary
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>