Skip to content

fix(ui): reliable session running indicator + swarm retry + version (#156, supersedes #159)#160

Merged
warren618 merged 3 commits into
mainfrom
fix/session-running-indicator
Jun 1, 2026
Merged

fix(ui): reliable session running indicator + swarm retry + version (#156, supersedes #159)#160
warren618 merged 3 commits into
mainfrom
fix/session-running-indicator

Conversation

@warren618

Copy link
Copy Markdown
Collaborator

Lands the session running-status indicator scoped out of #159, completes the swarm-retry capability into something actually usable, and fixes the #156 version drift. Credit for the UI indicator and the swarm-retry origin goes to @ai7eam-dev (Co-authored-by on both commits).

1. Session running-status indicator (from #159, scoped)

The indicator flickered or vanished on reconnect / page reload / sidebar.

  • useSSE: add attempt.created/started, message.received, session.created, tool_heartbeat, llm_usage to knownTypes so a mid-stream replay still surfaces the working state
  • stores/agent: track streamingSessionId, preserved across switchSession so the sidebar spinner persists when navigating away from a running session
  • Agent.tsx: handle attempt.created/started (re-affirm streaming on reconnect/reload), keep streaming alive on tool_heartbeat, persistent pulse bar, reword "Thinking…" → "Agent is working…"
  • Layout: replace the dead-code status === "failed" dot with a spinning Loader2 for the streaming session
  • index.css: pulse-slide keyframe

Dropped from #159 on purpose: the correlation fix (landed in #158), the SSE/LLM timeout change (landed in #157), and the agent/src/providers/llm.py default bump (protected module — needs separate discussion).

2. Swarm retry (HTTP + MCP)

#159 added a retry endpoint + an unused api.ts method but no usable trigger. Completed end-to-end:

  • api_server: POST /swarm/runs/{id}/retry — reconciles a stale "running" run first, refuses a genuinely active run (409), else re-launches a new run with the original preset + user_vars
  • mcp_server: retry_run(run_id) tool, so the list_runs → spot-failure → retry loop works from OpenClaw / Claude Desktop (the frontend has no swarm dashboard; MCP + HTTP are the real consumers)
  • api.ts: retrySwarmRun client method (parity with cancelSwarmRun)

3. Version drift (#156)

The shipped 0.1.8 wheel reported 0.1.7 from a hardcoded constant. cli/_version.py now derives the version from package metadata, falling back to reading pyproject.toml directly — pyproject.toml is the single source of truth, no constant left to drift.

Tests

  • test_swarm_retry.py (new): missing-run / running-refused / happy-path relaunch
  • test_cli_version.py (new): pyproject fallback matches declared version, resolved-not-unknown, guard against reintroducing a hardcoded version literal
  • test_mcp_regression.py: lock retry_run as a well-known tool
  • test_security_auth_api.py: traversal rejection for the new endpoint
  • Full suite: 2884 passed, 43 skipped; frontend tsc --noEmit clean + vite build passes

Notes

  • No protected-area changes (src/agent/, src/session/, src/providers/ untouched)
  • MCP tool count bumped 35 → 36 across the 5 READMEs. The ar/ko README prose still carries a stale 22-tool list — pre-existing localization debt, tracked separately, out of scope here.

Supersedes #159.

warren618 and others added 3 commits June 1, 2026 22:16
Scoped extraction of the UI running-status indicator from #159 (the
remaining commits there overlapped with #157/#158 or touched the
protected providers/ module).

- useSSE: add attempt.created/started, message.received, session.created,
  tool_heartbeat, llm_usage to knownTypes so a mid-stream reconnect/replay
  still surfaces the working state
- agent store: track streamingSessionId, preserved across switchSession so
  the sidebar spinner persists when navigating away from a running session
- Agent.tsx: handle attempt.created/started (re-affirm streaming on reconnect
  and page reload), keep streaming alive on tool_heartbeat, add a persistent
  pulse bar, reword "Thinking…" to "Agent is working…"
- Layout: replace the dead-code (status === "failed") dot with a spinning
  Loader2 for the actively streaming session
- index.css: pulse-slide keyframe for the running bar

Co-authored-by: ai7eam-dev <ai.7eam@gmail.com>
Completes the swarm-retry capability extracted from #159 and makes it
usable end-to-end instead of dead API surface.

- api_server: POST /swarm/runs/{id}/retry — reconciles a stale "running"
  run first, refuses a genuinely active run (409), else re-launches a new
  run with the original preset + user_vars
- mcp_server: retry_run(run_id) tool so the list_runs -> spot-failure ->
  retry loop works from OpenClaw/Claude Desktop (the frontend has no swarm
  dashboard; MCP + HTTP are the real consumers)
- api.ts: retrySwarmRun client method (parity with cancelSwarmRun)
- tests: missing-run / running-refused / happy-path relaunch, MCP well-known
  tool name, and HTTP traversal rejection for the new endpoint
- docs: bump current MCP tool count 35 -> 36 across the 5 READMEs (ar/ko
  prose still carries a stale 22-tool list — tracked separately)

Co-authored-by: ai7eam-dev <ai.7eam@gmail.com>
The shipped 0.1.8 wheel reported 0.1.7 because a hardcoded constant was
not bumped on release. The metadata path already fixed installed packages;
this removes the remaining hardcoded fallback so an un-installed checkout
reads the version straight from pyproject.toml — making pyproject the one
and only place the version is written, with no constant left to drift.

- _version: tomllib-based pyproject fallback (>=3.11 guaranteed), "unknown"
  sentinel only if the tree is moved away from its pyproject.toml
- tests: pyproject fallback matches declared version, resolved-not-unknown,
  and a guard against reintroducing any hardcoded version literal
@warren618 warren618 merged commit c57751b into main Jun 1, 2026
1 check passed
@warren618 warren618 deleted the fix/session-running-indicator branch June 1, 2026 14:40
warren618 added a commit that referenced this pull request Jun 1, 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