Skip to content

(CODUX-220) Refresh the Stats invocation ledger realtime - #3025

Merged
numnx merged 2 commits into
feature/CODUX-220-reduce-invocation-visibility-latency-safelyfrom
task/feature-codux-22-t04-codex-027f723b-mrjhy1ad
Jul 13, 2026
Merged

(CODUX-220) Refresh the Stats invocation ledger realtime#3025
numnx merged 2 commits into
feature/CODUX-220-reduce-invocation-visibility-latency-safelyfrom
task/feature-codux-22-t04-codex-027f723b-mrjhy1ad

Conversation

@numnx

@numnx numnx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Refresh the Stats invocation ledger realtime

Automated task PR opened by Code UX for T04.

📋 Summary

Sprint: Sprint 220 · Reduce invocation visibility latency safely · Task: T04

Make CLI task-coding execution invocations server-visible immediately after cancellation registration and before workspace preparation, while preserving truthful provider telemetry, recovery semantics, server-authoritative dashboards, and realtime Stats freshness.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.6-sol

⏱️ Timing

Started 2026-07-13 17:28:50 UTC
Finished 2026-07-13 17:38:10 UTC
Duration 9m 20s

📊 Token Usage

Metric Value
Input tokens 157,860
Cached input tokens 3,446,784
Output tokens 17,038
Total tokens 3,621,682
Invocations 1
Tool calls 39
Active time 8m 41s

Included usage estimate (subscription/local login): $3.02

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Add project-scoped realtime invalidation to the Stats → System invocation ledger while preserving its current pagination, filters, sorting, search, loading, and request-ordering behavior.

## Scope
- `dashboard/src/v2/pages/stats/hooks/use-system-view-data.ts`
- `dashboard/src/v2/pages/stats/components/system/SystemStudio.tsx` only if wiring requires it
- `dashboard/src/v2/pages/stats/__tests__/use-system-view-data.test.tsx`
- Existing `subscribeToDashboardRealtime` and dashboard realtime event contracts

## Implementation Requirements
1. Subscribe to the selected project scope and trigger the existing paginated/filter-aware invocation query on `project.execution.updated` and `snapshot_required`.
2. Preserve displayed rows during background refresh, retain page/filter/sort/search state, abort superseded requests, and use request sequencing so an older response cannot overwrite newer data.
3. Coalesce bursts of matching realtime events into one refetch and avoid polling, render churn, or duplicate snapshot requests.
4. Add deterministic tests for both event types, burst deduplication, abort behavior, stale-response rejection, and preservation of query parameters and current page.

## Constraints
- Reuse existing realtime client and invocation API contracts; do not add dependencies.
- Do not replace the current server query with a broad snapshot or polling loop.
- Do not change Live's intentional five-second heavy snapshot throttle.
- Keep the existing legacy fallback and error behavior intact.

## Verification
- Run `pnpm exec vitest run dashboard/src/v2/pages/stats/__tests__/use-system-view-data.test.tsx`.
- Confirm execution events refetch the current query, retain existing rows while loading, and never allow stale responses to overwrite the latest result.
- Run `pnpm run test:dashboard` and `pnpm run lint`.
🌿 Branch Info

Base: feature/CODUX-220-reduce-invocation-visibility-latency-safely
Head: task/feature-codux-22-t04-codex-027f723b-mrjhy1ad


🤖 Generated by Code UX

@numnx
numnx merged commit fc423e5 into feature/CODUX-220-reduce-invocation-visibility-latency-safely Jul 13, 2026
20 checks passed
@numnx
numnx deleted the task/feature-codux-22-t04-codex-027f723b-mrjhy1ad branch July 13, 2026 18:11
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