#8522: feat(control-ui): Add Model Requests panel for real-time API monitoring
docs
app: web-ui
gateway
stale
Cluster:
UI and Model Management Enhancements
Add a new 'Requests' tab to the Control UI that displays all model API calls with their success/failure status, timing, token usage, and error details in real-time.
Features:
- Real-time monitoring of all model API requests via WebSocket events
- Display request status (pending/success/error) with clear visual indicators
- Show timing information (duration, start time)
- Display token usage (input/output/cache) and estimated cost
- Detailed error information including HTTP status, error message, and whether the error is retryable
- Auto-refresh toggle for live updates
- Clear history functionality
Technical changes:
- New model-request-events.ts event system for tracking request lifecycle
- Gateway RPC methods: model-requests.list, model-requests.clear
- WebSocket 'model.request' event broadcasting
- Integration with agent-runner.ts for request tracking
- New Requests view component with styled request list
This addresses the need for visibility into API call failures without having to dig through log files.
Closes #TBD
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a new “Requests” tab to the Control UI that surfaces recent model API calls in real time. On the backend it introduces an in-memory model-request event bus (`src/infra/model-request-events.ts`), exposes RPC methods to list/clear recent requests (`src/gateway/server-methods/model-requests.ts`), and broadcasts `model.request` events from the gateway (`src/gateway/server.impl.ts`). On the frontend it adds view/state wiring for rendering the request stream and toggling auto-refresh (`ui/src/ui/views/requests.ts`, `ui/src/ui/app.ts`, `ui/src/ui/app-render.ts`, `ui/src/ui/app-gateway.ts`, `ui/src/ui/navigation.ts`).
Main issues to address are (1) request lifecycle tracking in `agent-runner.ts` doesn’t emit error/terminal states (so failures can remain stuck as pending / not show up), and (2) the new RPC methods and event are not included in the gateway’s canonical method/event registries (`src/gateway/server-methods-list.ts`), which may break discovery/negotiation depending on how `attachGatewayWsHandlers` enforces those lists.
<h3>Confidence Score: 3/5</h3>
- This PR is mergeable after addressing a couple integration gaps that can break the feature’s core functionality.
- The UI wiring and RPC handlers are straightforward, but there are two meaningful correctness risks: request events aren’t marked as error/terminal in `agent-runner.ts`, and the new RPC methods + websocket event are missing from the gateway method/event registries, which can prevent clients from discovering/subscribing depending on enforcement. The remaining notes are mostly type-safety/perf nits.
- src/auto-reply/reply/agent-runner.ts, src/gateway/server-methods-list.ts, ui/src/ui/app-gateway.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12168: feat: integrate Mission Control dashboard into Control UI
by riftagent-git · 2026-02-08
78.4%
#6440: feat(ui): add model picker dialog with provider filtering
by igorls · 2026-02-01
77.6%
#8546: Fix/config UI improvements
by RandomRaine · 2026-02-04
77.2%
#7794: fix(tui): refresh session info periodically to reflect config changes
by GuoxiangZu · 2026-02-03
76.8%
#9218: Fix Control UI chat resync on gaps and terminal events
by figitaki · 2026-02-05
76.8%
#8083: fix(tui): update model status immediately after /model command
by rohanjangala · 2026-02-03
76.8%
#14618: feat(ui): add AgentHQ - agent workspace evolution viewer
by eddie333016 · 2026-02-12
76.8%
#13902: fix: auto-recover on event gap instead of showing error
by nikogamulin · 2026-02-11
76.4%
#12314: fix: treat HTTP 5xx server errors as failover-worthy
by hsssgdtc · 2026-02-09
76.4%
#20875: feat(gateway): Add /config HTTP endpoint for external dashboards
by abhiramee08b021 · 2026-02-19
75.9%