Skip to content

Fix agent session menu width - #3096

Merged
steipete merged 1 commit into
steipete:mainfrom
KaranocaVe:fix/agent-session-menu-width
Aug 20, 2026
Merged

Fix agent session menu width#3096
steipete merged 1 commit into
steipete:mainfrom
KaranocaVe:fix/agent-session-menu-width

Conversation

@KaranocaVe

Copy link
Copy Markdown
Contributor

Summary

  • Render Agent Session actions as fixed-width hosted menu rows with single-line tail truncation.
  • Keep long session/project text out of menu-width measurement and cache keys.
  • Preserve full labels in tooltips and add a regression test for long project names.

Validation

  • swift build
  • make check
  • Focused SwiftFormat and SwiftLint on changed files

The full test suite and a live app relaunch were intentionally not run for this scoped UI change.

@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@KaranocaVe
KaranocaVe marked this pull request as ready for review August 20, 2026 07:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e1e990635

ℹ️ 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".

Comment on lines +126 to +128
onClick: { [weak self] in
self?.focusAgentSession(id: session.id, remoteHost: remoteHost)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Dismiss the menu before focusing a remote session

When a remote session row is clicked with the pointer or activated through VoiceOver, this onClick path invokes the closure directly and therefore keeps the custom-view menu open; unlike the previous native NSMenuItem action, the asynchronous remote focus operation never activates another local application to dismiss it. The CodexBar popup consequently remains open after the remote focus request, so cancel menu tracking before dispatching the focus action.

Useful? React with 👍 / 👎.

Comment on lines +130 to +135
// The hosted row handles pointer input. Preserve AppKit's keyboard activation path too.
item.target = self
item.action = selector
// Keep the card identifier in `representedObject` for view recycling and height caching.
// The native action gets its payload from the private identifier instead.
item.identifier = AgentSessionMenuItemIdentifier.make(sessionID: session.id, remoteHost: remoteHost)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the keyboard payload synchronized during cached swaps

In the merged-menu cached-switch path, hosted rows exchange their payloads through swapMenuItemMetadataKeepingViews, but that helper does not exchange NSMenuItem.identifier. When provider/overview sections have different row counts, an agent-session row can reuse a shell from another hosted row (or an adjacent session), leaving this newly stored identifier absent or associated with the wrong session; pointer clicks use the updated closure, but Return-key activation calls focusAgentSession(_:) with the stale identifier and either does nothing or focuses the wrong session. The identifier must be transferred with the rest of the item metadata.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 20, 2026, 4:26 AM ET / 08:26 UTC.

ClawSweeper review

What this changes

This PR renders Agent Session actions as fixed-width, single-line hosted menu rows so long project names truncate instead of widening the popup.

Merge readiness

Blocked until real behavior proof is added - 10 items remain

Keep open: the width fix is still needed on current main, but the hosted-row conversion introduces two P2 activation regressions and lacks real after-fix UI proof.

Priority: P2
Reviewed head: 5e1e9906352e35ca3c3e23e41262fbf8b35d2127

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The width approach is plausible, but two concrete interaction regressions and missing real behavior proof prevent merge readiness.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: Build and lint claims are not after-fix behavior proof; add a redacted fresh-menu screenshot or recording showing truncation and session activation, then update the PR body for re-review.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Build and lint claims are not after-fix behavior proof; add a redacted fresh-menu screenshot or recording showing truncation and session activation, then update the PR body for re-review.
Evidence reviewed 5 items Current main still needs the width fix: Current main retains native Agent Session actions that obtain their payload from representedObject; the relevant source paths are unchanged from this PR's base, so main does not contain the proposed hosted fixed-width rows.
Hosted pointer path bypasses native menu dismissal: The new row invokes focus through an onClick closure; the shared hosted-row implementation documents that this path keeps the menu open, while remote focus only starts an asynchronous request.
Cached swaps leave the new keyboard payload stale: This PR moves the native action payload into NSMenuItem.identifier, but the existing hosted-row metadata swap exchanges action and representedObject without exchanging identifier.
Findings 2 actionable findings [P2] Dismiss the menu before focusing a hosted session
[P2] Swap the session action identifier with cached row metadata
Security None None.

Live Verification

Command: ./Scripts/compile_and_run.sh

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: OK: CodexBar is running.

How this fits together

CodexBar builds a macOS status menu from session descriptors; Agent Session entries are interactive rows that focus a local window or send a remote focus request. Menu-width measurement runs before those rows are installed.

flowchart LR
A[Session scan] --> B[Menu descriptor]
B --> C[Width measurement]
C --> D[Hosted session row]
D --> E[Pointer or keyboard activation]
E --> F[Local or remote focus]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Build and lint claims are not after-fix behavior proof; add a redacted fresh-menu screenshot or recording showing truncation and session activation, then update the PR body for re-review.
  • Dismiss the menu before focusing a hosted session (P2) - This closure bypasses NSMenuItem.action; hosted-row pointer and VoiceOver activation intentionally keeps the menu open. Remote focus only starts an async request, so selecting a remote session leaves the popup tracked instead of matching the previous native-item behavior.
  • Swap the session action identifier with cached row metadata (P2) - Keyboard activation reads the new payload from identifier, but the cached hosted-row swap transfers action and representedObject without transferring identifier. After a merged-menu switch reuses a row, Return can therefore do nothing or focus the prior session.
  • Resolve merge risk (P1) - Pointer and VoiceOver activation of a remote session leaves the status menu open after dispatching the focus request.
  • Resolve merge risk (P1) - After a cached menu-content swap, keyboard activation can use a missing or stale session identifier and focus the wrong session or no session.
  • Resolve merge risk (P1) - No redacted after-fix native-menu proof demonstrates truncation or activation behavior.
  • Complete next step (P2) - Two narrow source-proven P2 defects have a mechanical repair path, while the contributor must separately provide real behavior proof.
  • Improve patch quality - Repair menu dismissal and cached keyboard payload transfer with focused regression coverage.
  • Improve patch quality - Add redacted native-menu proof for a long session label and local or remote activation.
  • Improve patch quality - Run make test in addition to the existing build and check validation.

Findings

  • [P2] Dismiss the menu before focusing a hosted session — Sources/CodexBar/StatusItemController+AgentSessions.swift:126-128
  • [P2] Swap the session action identifier with cached row metadata — Sources/CodexBar/StatusItemController+AgentSessions.swift:130-135
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta 5 files; production +150/-46, tests +70 The UI refactor adds 104 net production lines alongside one width-cache regression test.

Merge-risk options

Maintainer options:

  1. Repair session-row activation (recommended)
    Dismiss the tracked menu for hosted pointer and accessibility activation, swap the identifier with other cached metadata, and add focused regression coverage.
  2. Pause for visible proof
    Wait for a redacted fresh-bundle demonstration of long-label truncation and session activation after the code defects are repaired.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve native menu dismissal for hosted session activation, swap NSMenuItem.identifier during cached content swaps, and add focused regression tests for remote and keyboard activation.

Technical review

Best possible solution:

Preserve native dismissal semantics for hosted session activation, transfer the keyboard identifier during cached swaps, cover both paths, and attach redacted fresh-bundle UI proof before merge.

Do we have a high-confidence way to reproduce the issue?

Yes—source reproducibly shows that a long session title enters native menu-width measurement on current main; the PR’s hosted action path and cached-swap path also establish the two proposed regressions without a live UI run.

Is this the best way to solve the issue?

No: fixed-width hosted rows address the width issue, but this implementation must also preserve menu dismissal and synchronize the keyboard payload during cached swaps.

Full review comments:

  • [P2] Dismiss the menu before focusing a hosted session — Sources/CodexBar/StatusItemController+AgentSessions.swift:126-128
    This closure bypasses NSMenuItem.action; hosted-row pointer and VoiceOver activation intentionally keeps the menu open. Remote focus only starts an async request, so selecting a remote session leaves the popup tracked instead of matching the previous native-item behavior.
    Confidence: 0.99
  • [P2] Swap the session action identifier with cached row metadata — Sources/CodexBar/StatusItemController+AgentSessions.swift:130-135
    Keyboard activation reads the new payload from identifier, but the cached hosted-row swap transfers action and representedObject without transferring identifier. After a merged-menu switch reuses a row, Return can therefore do nothing or focus the prior session.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 84a4ca725d5d.

Labels

Label changes:

  • add P2: The PR changes a bounded but user-facing Agent Session menu workflow and currently has two concrete activation regressions.
  • add merge-risk: 🚨 compatibility: Replacing native session items with hosted rows can break established pointer, accessibility, and keyboard activation behavior.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Build and lint claims are not after-fix behavior proof; add a redacted fresh-menu screenshot or recording showing truncation and session activation, then update the PR body for re-review.

Label justifications:

  • P2: The PR changes a bounded but user-facing Agent Session menu workflow and currently has two concrete activation regressions.
  • merge-risk: 🚨 compatibility: Replacing native session items with hosted rows can break established pointer, accessibility, and keyboard activation behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Build and lint claims are not after-fix behavior proof; add a redacted fresh-menu screenshot or recording showing truncation and session activation, then update the PR body for re-review.

Evidence

Acceptance criteria:

  • [P1] make test.
  • [P1] make check.
  • [P1] Fresh-bundle native menu run showing a long Agent Session label truncates at the normal menu width and remote plus keyboard activation target the selected session.

What I checked:

Likely related people:

  • Giuseppe Bisemi: Current-main blame assigns both the focus action and cache-swap implementation to the provider-lanes integration commit. (role: introduced current menu and Agent Session integration; confidence: high; commits: 83e7deb3566e; files: Sources/CodexBar/StatusItemController+AgentSessions.swift, Sources/CodexBar/StatusItemController+MenuReconcile.swift, Sources/CodexBar/AgentSessionsStore.swift)
  • Peter Steinberger: Feature history identifies the original cross-machine Agent Sessions implementation and a later Agent Sessions menu-refresh fix. (role: introduced Agent Sessions feature; confidence: high; commits: 8106e7d3cc31, 6072edc2bfbc; files: Sources/CodexBar/StatusItemController+AgentSessions.swift, Sources/CodexBar/AgentSessionsStore.swift, Sources/CodexBar/MenuDescriptor.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@KaranocaVe

Copy link
Copy Markdown
Contributor Author

this robot is crazy

@steipete
steipete merged commit 36e2be4 into steipete:main Aug 20, 2026
1 check passed
steipete added a commit that referenced this pull request Aug 20, 2026
steipete added a commit that referenced this pull request Aug 20, 2026
* feat(kiro): show overage credits against their cap

kiro-cli /usage states plan credits alone and omits the overage section
for organization accounts, so a spent plan looks like the account is out.
Read GetUsageLimits with the CLI's own token (read-only) and surface
overage as a second credit window plus charges against the overage budget.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): reject impossible usage counters from GetUsageLimits

An overage larger than total usage would clamp planUsed to zero and
overwrite valid CLI numbers. Honor API-disabled overage over a stale
CLI Enabled line so enrichment cannot resurrect a cap the API says is off.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): reject GetUsageLimits payloads that exceed the plan

Drop enrichment when plan usage is above the plan ceiling, and treat an unrecognized overage status as unknown so the CLI overage line can still stand.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: import FoundationNetworking for Linux URLSession types

* fix(kiro): resolve the CLI state database on Linux

GetUsageLimits enrichment always looked under macOS Application Support,
so Linux refreshes never found data.sqlite3.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): reject overage above cap and honor API currency

Best-effort GetUsageLimits data should not present a spend window
above its ceiling or format non-USD charges as dollars.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): propagate cancellation from usage-limits enrichment

A cancelled GetUsageLimits call now fails the refresh instead of publishing a CLI-only snapshot as success.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): drop CLI USD overage estimate when the API currency is not USD

A missing overageCharges field no longer lets a dollar CLI fallback render in the API's non-USD currency.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): add locale entries for overage copy

Translate the new Overage window title and Overage credits left detail row in every app catalog so non-English UIs no longer fall back to English.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): honor API-disabled overage and localize cap phrases

GetUsageLimits DISABLED now replaces a stale CLI Enabled status, and Kiro "of N" detail values go through the of %@ localization key.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(i18n): expect localized OpenRouter API key details in zh-Hant

Provider detail titles and catalogued labels go through L after #3084, so the popup test must assert the Traditional Chinese strings.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): clamp overage that runs slightly past the cap

Rejecting over-cap counters dropped the whole GetUsageLimits payload and hid overage on organization accounts, so the gauge now clamps to the cap instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): keep over-cap overage and localize credit units

Clamping hid the amount Kiro actually billed, and overage usage still rendered the English "credits" suffix in other locales.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(kiro): keep CLI overage when API omits the cap

ENABLED without overageCapWithPrecision is incomplete enrichment, not a disabled account.

* fix(kiro): mark API-enabled overage when the CLI omits it

Organization accounts skip the CLI overage section, so the menu-bar modes never saw an Enabled row.

* fix(kiro): keep CLI plan usage when API bonuses are present

GetUsageLimits folds bonus spend into currentUsage, so overwriting the plan gauge would double-count bonus credits.

* fix(kiro): parse bonus-inclusive usage above the plan limit

GetUsageLimits folds bonus spend into currentUsage, so rejecting planUsed > planLimit dropped overage enrichment for those accounts.

* fix: preserve stacked menu bar layout line breaks (#3094)

* Preserve card menu-item subclass during cached swaps (#3093)

* Preserve menu item subclasses during cached swaps

* Add native menu proof for cached shell swaps

---------

Co-authored-by: Kiran Magic <262980978+kiranmagic7@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>

* docs: changelog for #3093

* Extend menu bar conditionals beyond usage percentages (#3088)

* Extend menu bar conditionals beyond usage percentages

Conditional predicates could only compare four percent-used windows. They now
compare 18 metrics across four units: percent windows, the direct
primary/secondary/tertiary lanes, four reset countdowns, three pace deltas,
run-out, credit balance, and today/30-day cost. Metrics with two readings
(percent windows, lanes, balance) gain a used/remaining select, so
"session > 50% used and session resets in < 2h" is expressible.

Pace, run-out, balance and cost were only carried as display strings, which
cannot be compared, so MenuBarLayoutRenderMetrics carries their numeric twins
pre-rounded to the same granularity as the text they mirror.

Three refresh gates needed widening for the new data dependencies:
- The title cache key had no component that moves with the clock, so a
  countdown predicate would have served its pre-flip title indefinitely. It now
  keys on the per-conditional outcome, evaluated once per render.
- The four observation signatures gated on display tokens; a predicate on cost
  or balance has no token. They now also read the conditionals' metrics, which
  additionally fixes lane tokens inside conditional branches being invisible to
  the lane signature.
- A reset-countdown predicate flips at an instant nothing else ticks on, so the
  countdown scheduler wakes at `resetsAt - threshold`.

The conditional library is now decoded element-wise: this change makes
forward-incompatible metric values possible for the first time, and one unknown
value would otherwise have wiped the whole library on a downgrade.

Ships an "Auto % / Resets in" default that renders the automatic percentage
while the lane has headroom and the reset countdown once it is spent.

* Sign the readings conditional predicates actually compare

Three observation-signature gaps let a predicate flip without a redraw:

- Cost signatures recorded only the currency-formatted string, so two token-cost
  updates could cross a threshold while both formatted to the same cent. A
  referenced cost metric now signs the unrounded amount losslessly.
- The balance signature recorded only the rendered "Remaining" row, so a
  `balance used` predicate — which reads the "Used" row no token surfaces — was
  entirely unsigned. Both amounts are now signed.
- The lane signature recorded the displayed reading, which follows
  `usageBarsShowUsed` and clamps remaining at zero, while `RateWindow.usedPercent`
  deliberately preserves over-quota values. A used-direction predicate such as
  `primaryLane > 105%` could move 104% -> 106% against a constant `0.000`.

The lane signature is now scoped to what the layout renders, and a new
conditional-window signature covers what conditionals read: the raw used percent
(which remaining derives from, so it covers both directions) plus `resetsAt`,
which countdown predicates depend on and no display token contributes.

* Tick clock-derived predicates that no token schedules

`menuBarWeeklyPaceRefreshDelays` is gated on a placed `.pace(.weekly)` token and
only wakes once, at the pace-eligibility boundary. Excluding `runsOutIn` from the
conditional reset schedule on the assumption that scheduler covered it therefore
left a hole: a layout whose only pace or run-out reference is a predicate got no
clock wake-up at all, so it kept rendering the branch that was true when the
value last moved.

Referenced weekly-pace predicates now also trigger the eligibility wake-up, and
any referenced pace or run-out predicate schedules a minute tick. Both numbers
are pre-rounded to the granularity the menu bar shows -- whole percentage points
and whole minutes -- so a minute tick is exactly enough, and it is the cadence a
`.resetCountdown` token already costs. Money predicates deliberately schedule
nothing: they move only when new provider data arrives.

* Keep older releases' conditional libraries readable on downgrade

Decoding the library element-wise only helps builds that already have the
lenient decoder. The build a user actually downgrades to decodes
`menuBarLayoutConditionals` strictly and falls back to `[]`, so one saved rule
using a new metric would empty the entire library there.

The conditional library now dual-writes the way layouts already do:
`menuBarLayoutConditionalsV2` keeps full fidelity, and the original key keeps an
older-readable projection. `loadLibrary` mirrors `preferredLayout` — the current
key wins unless the legacy key disagrees with its own projection, which only
happens when an older release wrote it, and that edit must survive.

The projection drops an entry when any clause uses a metric outside the original
four, and also when any clause uses a non-`.used` direction. The second case is
the subtler one: an older release's synthesized decoder ignores the unknown
`direction` key, so `session remaining > 80` would come back as
`session used > 80` and render the opposite branch. A missing rule is visibly
missing; an inverted one is not.

* Drop cost metrics that could not be converted to USD

`UsageFormatter.convertedCost` returns the source amount unchanged when it has no
rate for the provider's currency, and both cost producers passed that value
straight through as `costTodayUSD`/`cost30dUSD`. A `Cost today > 5 USD` rule
would then compare, say, €6 against a $5 threshold and pick the wrong branch.

Both producers now keep the amount only when the conversion actually landed in
USD. Otherwise the predicate sees no value and evaluates false, which is the
existing contract for a metric the provider does not report. The rendered text is
untouched and still shows the provider's own currency.

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>

* Prevent RPC pipe writes from aborting after child exit (#3095)

* fix: prevent RPC pipe writes from aborting after child exit

* test: repin UsageFetcher codex identity anchor after pipe-write refactor

* Publish live Grok tokens and xAI spend into Usage & Spend (#3085)

* Publish live Grok tokens and xAI spend into Usage & Spend

Enabled Grok and xAI now join the shared spend catalog instead of only
inflating the unavailable denominator. xAI contributes vendor-metered
daily USD from the Management API chart; Grok contributes local session
tokens. SuperGrok credits and xAI prepaid balance stay quotas, not spend.

* docs: add #3085 to changelog

* Fix lint on Grok and xAI spend messages

Wrap no-data copy under 120 characters and drop a redundant throws
on the prepaid-balance mapping test.

* Fix Grok/xAI spend publication, Today, and coverage

Preserve xAI analytics failures as unavailable instead of known-zero
spend, publish local Grok tokens when remote billing fails, pin Today
to the current UTC/local day, and keep xAI history as a 30-day source.

* Fix Grok and xAI spend edge cases

* Fix OpenRouter localization test after #3086

#3086 scoped localizedProviderDetails to DeepSeek and z.ai, so generic
OpenRouter details keep canonical English. The merge test still expected
zh-Hant "API 金鑰" and failed macOS shard 0.

* Align OpenRouter localization test with main

Peter restored generic title/row L() localization in 84a4ca7 after
#3086 scoped it away. The merge kept the canonical-English assertion
from the earlier CI fix; match the restored shared catalog instead.

* test: reconcile gatekeeper anchors and fingerprints with Grok/xAI spend clusters

* test: include Grok and xAI in the cost-capable dashboard source contract

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>

* docs: credit #3085 and #3088 changelog entries

* chore: finalize 0.54.0 changelog and bump build to 127

* docs: update appcast for 0.54.0

* chore: open 0.54.1 unreleased changelog section

* Clarify five-hour quota wording in Simplified Chinese (#3070)

* Clarify Simplified Chinese five-hour quota label

* Derive Simplified Chinese session quota labels from duration

---------

Co-authored-by: UNGETSU <ungetsu@UNGETSUdeMacBook-Air.local>

* Fix agent session menu width (#3096)

* fix(alibaba): resolve mainland Personal/Solo sec_token from the console shell (#3098)

Mainland Personal/Solo Token Plan (cn-personal) fails with a 200
`BailianGateway.Login.NotLogined` body ("Alibaba Token Plan login required")
even with fresh, valid aliyun cookies, because the request lacks the
`sec_token` the OneConsole gateway requires. #2533 already forwards the token
when present, but it was never resolvable for this path for two reasons:

- The console shell only server-renders `window.ALIYUN_CONSOLE_CONFIG.SEC_TOKEN`
  for a genuine same-origin document navigation; a bare GET receives a
  token-less shell. Send the browser-navigation headers (Referer, Sec-Fetch-*,
  Accept-Language) so the shell includes the token.
- The shell embeds it as an upper-case, unquoted key (`SEC_TOKEN: "..."`), but
  `extractSECToken` only matched the lower-case `secToken`/`sec_token` shapes.
  Add the `SEC_TOKEN` pattern.

With both, the scraper resolves the Personal `sec_token`, the gateway returns
real usage, and the mainland Personal/Solo card renders. Verified end-to-end
on a real cn-personal account: `secTokenSource=resolved`, body `message=Success`,
5-hour/weekly windows populated (was "login required").

Adds AlibabaTokenPlanSECTokenScrapeTests covering the upper-case shell format,
the existing lower-case shapes, and the no-token case.

Refs #2500, #2349, #2370, #2533.

Co-authored-by: LeoLin <leolin990405@gmail.com>

* Add BigModel CN account balance to z.ai provider (#3109)

* Add BigModel CN account balance to z.ai provider

* Bound balance timeout, region-aware override validation, null-safe amounts

---------

Co-authored-by: RunhuaHuang <RunhuaHuang@users.noreply.github.com>

* docs: credit #3070 #3096 #3098 #3109 changelog entries

* test: repair gatekeeper anchors after #3096 menu refactor

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: kiranmagic7 <kiranmagic@proton.me>
Co-authored-by: Kiran Magic <262980978+kiranmagic7@users.noreply.github.com>
Co-authored-by: William Mitchell <13799071+wdmitchelluk@users.noreply.github.com>
Co-authored-by: Alec Gutman, Chip <44984861+Chipagosfinest@users.noreply.github.com>
Co-authored-by: UNGETSU <44204222+YunyueLi@users.noreply.github.com>
Co-authored-by: UNGETSU <ungetsu@UNGETSUdeMacBook-Air.local>
Co-authored-by: KaranocaVe <39995482+KaranocaVe@users.noreply.github.com>
Co-authored-by: Zhongyue Lin <101193087+LeoLin990405@users.noreply.github.com>
Co-authored-by: LeoLin <leolin990405@gmail.com>
Co-authored-by: Xigua <rh2897@columbia.edu>
Co-authored-by: RunhuaHuang <RunhuaHuang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants