Integrate clear context telemetry fixes / 集成清空上下文与统计面板修复#4329
Open
SivanCola wants to merge 9 commits into
Open
Integrate clear context telemetry fixes / 集成清空上下文与统计面板修复#4329SivanCola wants to merge 9 commits into
SivanCola wants to merge 9 commits into
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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