Integrate clear context telemetry fixes / 集成清空上下文与统计面板修复#4329
Conversation
Fixes esengine#4186 Sub-bug (a): /clear sometimes fails to clear context (stale events re-populate state after reset). Fix: guard usage handler with turnActive check so stale events from the previous session are dropped after the reset action zeros the state. Sub-bug (b): token info and workspace context not refreshed after /clear. Three causes: 1. Tab telemetry not reset — ClearSession() resets the executor session but tab.usageTelemetry/readTelemetry accumulate forever. Fix: add resetTelemetry() and call it from App.ClearSession(). 2. ContextPanel not refreshed — dockRefreshKey only bumps on turn_done, so the panel keeps showing stale data. Fix: bump dockRefreshKey in confirmClearContext. 3. Stale info fallback — ContextPanel line 212 falls back to info.usedTokens when context.used is 0, which is stale. Fix: clear info state when context.used and sessionTokens are both 0.
…text-integrated # Conflicts: # desktop/frontend/package.json
…text-integrated # Conflicts: # desktop/frontend/src/lib/useController.ts
Discard stale ContextPanel responses after clear-session refreshes and let ClearSession failures surface to the caller before showing success. Co-authored-by: ashishexee <144021866+ashishexee@users.noreply.github.com> Co-authored-by: lizhengwu <lizhengwu@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49894ca938
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
c1336ca to
5b61453
Compare
…329-conflicts # Conflicts: # desktop/frontend/package.json # desktop/tabs.go # internal/config/config.go
|
Supersession note: #4327 fixed the same #4186 Authorship note: @SivanCola is the primary author of this PR. @ashishexee contributed as a repository collaborator through #4327; their work is acknowledged as part of the shared fix for #4186. |
…text-integrated # Conflicts: # desktop/frontend/package.json
|
Resolved the latest Conflict resolution:
Local verification:
GitHub now reports this PR as mergeable. CI has been retriggered on the new head commit |
Summary
This integration PR fixes #4186 and folds the related overlapping PRs into one branch so the desktop context, billing, and workspace-status changes can land together without file-level conflicts.
Integrated PRs and contributions
/clear, refreshes the ContextPanel after clearing, and starts guarding stale usage events from repopulating cleared session totals.Integration fixes added here
ContextPanelresponses when a newer refresh has already started, so an old request cannot repopulate token data after/clear.ClearSessionbridge failures propagate to the confirmation flow before showing the success notice.package.jsonscripts.Verification
go test ./...go vet ./...go build ./cmd/reasonixgo test .in the desktop modulego vet .in the desktop modulenpm testgit diff --checkCo-contributors
Folded-in pricing update
price/prices, so existing installs adopt the new RMB defaults after opening the upgraded app.config_version = 3and does not run repeatedly.Additional superseded contributor PRs
These related PRs are being closed in favor of #4329 as the canonical integration route. Their authors are acknowledged as repository co-contributors for the cost, currency, balance, status-bar, and usage-visibility work represented by this integration effort.
¥to$after the first conversation turn, proposed balance currency as the preferred source of truth, and tightened reducer fallback behavior so displayed billing currency stays stable.Additional co-contributors acknowledged from these superseded PRs: @JesonChou, @jiaxindeyang-a11y, @Barsit, and @HUQIANTAO.