Files
t3code/packages/client-runtime
Theo BrowneandClaude Fable 5 4586d5f374 fix: address review handoff P1/P2 findings
P1:
- Claude workflow agents keyed by stable row index (parent:wf:N), not
  per-attempt agentId — queued/blocked rows now appear, retries update
  one card instead of duplicating
- agent.snapshot payloads carry a monotonic per-thread revision; client
  latest-wins selection uses it (deterministic under same-ms appends)
- Codex child turn/completed decodes turn.status: failed→failed with
  error summary, interrupted→stopped, completed→idle
- roster hydration is lazy (only on agent-touching events), no longer a
  full thread-detail load on every first event per thread

P2:
- reducer re-derives kind from event taskType/parent (no first-guess
  pinning); reactivation counts any settled→active transition
- workflow container rows excluded from worker counts; container usage
  only counted when it has no member rows
- settled cards lead with error/result, never stale activity text
- newest agents array is authoritative on the client — undecodable
  rosters no longer resurrect older running snapshots
- idle (resumable) agents no longer share the terminal retention pool
- Codex usage uses the cumulative total breakdown consistently

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-21 20:00:02 -07:00
..

Client Runtime

Shared client behavior for web and mobile. Public APIs are organized by package subpath. The package intentionally has no root export.

Public subpaths

Subpath Responsibility
authorization Bearer and DPoP authorization plus token persistence contracts
connection Targets, catalog, supervision, retries, registry, and onboarding
environment Environment identity, descriptors, endpoints, and scoped keys
errors Shared client error inspection
operations Multi-step application workflows
operations/projects Multi-step project creation workflows
platform Platform capability and persistence service contracts
relay Managed relay API and environment discovery
rpc HTTP/RPC clients, protocol, sessions, and subscriptions
state/<domain> Focused shared state, retention, reducers, and Atom constructors

Dependency direction

Platform applications provide platform services. connection composes those capabilities with authorization, relay, and rpc to supervise environment sessions. Independent state modules consume the connection registry and expose focused state or Atom constructors to application-owned runtimes.

Applications should import the narrowest relevant subpath. There is no broad state export: use domain paths such as state/shell, state/threads, state/terminal, or state/vcs. Subpath indices and explicitly exported domain files are public API boundaries; all other files remain implementation details.