Skip to content

console: live runtime events and guided bulk re-login - #603

Open
guyu233 wants to merge 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/console-live
Open

guyu233 wants to merge 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/console-live

Conversation

@guyu233

@guyu233 guyu233 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Change

Makes the console show what the server is actually doing instead of a locally invented animation, and turns the account batch actions into one guided flow.

  • Real event channel: /api/events (SSE) streams runtime state changes from internal/events; the overview in-flight card and account cards subscribe through useAccountEvents and drop the mock inflight generator.
  • Truthful bulk operations: check-in / probe / quota / maintenance fan out concurrently in the runtime and report per-account results over the event channel, instead of the UI faking progress.
  • Bulk re-login walkthrough: select accounts, open their login pages one at a time, sign in, and the console advances automatically; progress, waiting, timeout and cancel states are explicit (BatchReloginModal).
  • Checkbox fix: the re-login account checkbox is actually clickable now (HeroUI checkbox isSelected/onChange wiring).

Scope to review

  • Console/UI and runtime event notifications only. No changes to request routing, retries, provider cooldowns or billing.
  • The runtime now publishes account/maintenance state events; the event bus is in-process and best-effort (a slow subscriber cannot block a request).
  • Batch operations still run inside the existing concurrency guards; this only removes the artificial per-account serialization in the console handlers.

Verification

  • go test ./... passes.
  • go build ./... passes.
  • cd frontend && npm run sync rebuilt internal/webui/static.
  • Manual: overview in-flight numbers track real requests, account cards update without polling, re-login advances through selected accounts.

… concurrent

- Check-in all and refresh credits fan out to every account in one pass: the new
  bulk endpoints return one result per account with the verbatim upstream error,
  and the console no longer batches or queues requests.
- GET /api/events streams the runtime event bus (account / accounts / quota /
  checkin / refresh / bulk) with sequence replay. Console pages patch rows live
  and fall back to a 5s poll when the stream is unavailable.
- Check-in results carry the real reward credits plus code and HTTP status, and a
  provider that reports no status stays "unknown" instead of "success".
- Quota is persisted as the real upstream snapshot; force-ready overrides only
  enter the routing pool and the console badges them. Each quota snapshot states
  its age, and the synthetic inflight demo board plus its login showcase are gone.
- Video, audio and file content parts are refused with a real 400 invalid_request
  instead of being dropped during prompt assembly, and a shared head timeout makes
  Trae streams fail over when the upstream accepts a request and stays silent.
Select account cards, confirm, and the console authorizes them one at a time: start the provider login, show the authorization page, poll status, and advance automatically. Cancel stops the walkthrough; every row keeps its own state and the verbatim upstream message.
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