Skip to content

Reorder the agents in the panel, count Grok's tokens, and install Grok through mise - #14004

Merged
dhh merged 13 commits into
quattrofrom
agent-panel-reorder
Oct 2, 2026
Merged

dhh merged 13 commits into
quattrofrom
agent-panel-reorder

Conversation

@dhh

@dhh dhh commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

These commits were pushed to #13992's branch after it had been squash-merged, so they never reached quattro. Same commits, cherry-picked onto current quattro; the result is identical to the tip of that branch.

Ordering the agents

  • Drag an agent by its mark to move its section. The mark it would land on lights, and the move happens on release (moving live would rebuild the sections under the drag).
  • Each agent's header is a keyboard stop with its mark boxed, and Ctrl+Up/Down (or Ctrl+k/j) moves the agent the cursor is in. It does nothing when the cursor is outside an agent.
  • The order is kept in ~/.local/state/omarchy/agents/order.json; an agent it doesn't name yet keeps its place after the ones it does.
  • The shared key catcher only turns Ctrl+Up/Down into a reorder for panels that opt in (reorderable), so other panels are unchanged.
  • The scrolling area reaches a little into the panel's left padding, with the content shifted back, so the box around a lit mark isn't clipped.

Grok through mise's first-party package

Brings in #13889 (by @j-c-m) unchanged: grok installs from mise's own grok package instead of npm:@xai-official/grok, with a migration that rewrites Omarchy's npm wrapper, drops the npm tool, and removes the x.ai installer's agent link. That fixes the stuck version at its cause, so the upkeep #13992 added to omarchy-update-mise (and the two fixes to it below) is removed again, omarchy-update-mise is back to only mise up, added Grok accounts no longer share a bin directory, and adding a first Grok account installs the same package.

Grok tokens

The Grok collector reads each session's usage.json, the ledger grok usage prints, with every finished turn's end time and tokens by model. Grok now reports tokens today, by day for the last week, and by model (cached input kept apart, as Claude and Codex do), and today's prompts by the turns that ended today. The source came from #12352's research.

Review fixes

  • Greptile: reordering is off while an account name is being edited, so it can't drop an unfinished rename.

  • Greptile: a Grok session scan is only reused on the day it was made, so yesterday's sessions don't count as today's after midnight.

  • Codex: omarchy-update-mise exits with mise up's status, so the Grok upkeep can't hide a failed tool update; and a Grok update is unpacked into ~/.grok even when GROK_HOME points elsewhere, so the link it replaces actually comes back at the new release.

Tests

  • agents-panel-test.sh covers the header stops, the reorder wiring, the opt-in, and Ctrl+Up/Down outside an agent; agent-usage-grok-test.sh the day-bound scan; update-mise-grok-test.sh the exit status and the pinned home.
  • Checked in the running shell: Ctrl+Up/Down moves an agent and its mark stays lit; the box draws whole. Dragging by mouse is untested.

🤖 Generated with Claude Code

dhh and others added 7 commits October 1, 2026 20:58
Drag an agent by its mark to move its section; the header it will land
on lights up, and the move happens on release. Each agent's header is
now a keyboard stop with its own highlight, and Ctrl+Up/Down moves the
agent the cursor is in. The order is kept in agents/order.json beside
the usage records. The key catcher turns Ctrl+Up/Down into a reorder
only for panels that opt in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mark is the handle the agent moves by, so the keyboard cursor and
the drop spot while dragging box it alone rather than the header line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The box overhangs the content's left edge, which the scrolling area
clipped. The scrolling area now reaches a little into the panel's
padding with the content shifted back, so nothing moves and the box
draws whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A limits-only refresh just after midnight reused a scan from the evening
before, which counted yesterday's sessions as today's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hero's buttons and the starter tiles carry indices too, and the
lookup read them as accounts, so with several accounts Ctrl+Up/Down on
one of them moved an unrelated agent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Grok block ran after `mise up` and its last command set the script's
status, so a failed tool update could read as a success to callers that
warn about it. The update's own status is now the script's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The upkeep replaces ~/.grok's link, but the npm launcher unpacks into
GROK_HOME when it's set, so with a custom home the link never came back
at the new release and the old one was restored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Switches Grok installation from npm to mise, reorders agents in UI.

The PR appears safe to merge; no outstanding finding or new blocking issue was established.

Summary

The PR adds persistent agent ordering, collects Grok token usage from session ledgers, and migrates Grok installation from the npm wrapper to mise’s first-party package.

  • Since the previous review, daily totals were aligned with the model token buckets, and the migration gained cleanup for binaries left by the npm launcher.
  • No new actionable issue was established.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Agent panel] --> B[Saved provider order]
  C[Grok session usage.json] --> D[Usage collector]
  D --> A
  E[Legacy npm wrapper] --> F[Grok migration]
  F --> G[Mise grok package]
Loading

Reviews (4) · Last reviewed commit: "Remove the npm launcher's old Grok binar..."

Comment thread shell/plugins/agents/Panel.qml Resolved
Comment thread bin/omarchy-update-mise Resolved
Comment thread test/shell.d/agents-panel-test.sh Resolved
dhh and others added 3 commits October 1, 2026 21:06
Ctrl+Up/Down reached the key catcher during an inline rename, and moving
the agent rebuilt its section, dropping the unfinished name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The npm launcher keeps an old ~/.grok/bin binary because mise skips its
postinstall. Use mise's grok tool, and drop the npm tool so its shim
does not stay ahead of the stub.
With Grok installed through mise's first-party package, the CLI is the
binary mise manages, so the update upkeep that repointed ~/.grok/bin and
the shared bin directory for added Grok accounts have nothing left to do.
omarchy-update-mise is back to running mise up and nothing else, and
adding a first Grok account installs the same package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh dhh changed the title Reorder the agents in the panel, and finish the Grok review fixes Reorder the agents in the panel, and install Grok through mise's own package Oct 2, 2026
Comment thread migrations/1790863209.sh Resolved
Comment thread migrations/1790863209.sh Resolved
Each Grok session keeps a usage.json, the ledger `grok usage` prints, with
every finished turn's end time and tokens by model. The collector now
reads it for tokens today, by day for the last week, and by model, with
cached input kept apart, and counts today's prompts by the turns that
ended today. Found in #12352's research.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh dhh changed the title Reorder the agents in the panel, and install Grok through mise's own package Reorder the agents in the panel, count Grok's tokens, and install Grok through mise Oct 2, 2026
Comment thread bin/omarchy-agent-usage-grok Resolved
dhh and others added 2 commits October 1, 2026 21:31
Grok's totalTokens leaves cache writes out while the per-model buckets
count them, so a turn with cache writes added less to its day than to
its model. The day's total is now the sum of those same buckets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Omarchy's npm wrapper ran the binary the launcher unpacked into
~/.grok/bin, where x.ai's installer also puts a copy with a PATH entry
ahead of mise. Once the wrapper is replaced, a binary left there would
keep shadowing the mise tool, so the migration removes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh
dhh merged commit 821ae58 into quattro Oct 2, 2026
1 check passed
@dhh
dhh deleted the agent-panel-reorder branch October 2, 2026 01:35
sgruendel pushed a commit to sgruendel/omarchy that referenced this pull request Oct 3, 2026
…k through mise (omacom#14004)

* Let the agents in the panel be put in any order

Drag an agent by its mark to move its section; the header it will land
on lights up, and the move happens on release. Each agent's header is
now a keyboard stop with its own highlight, and Ctrl+Up/Down moves the
agent the cursor is in. The order is kept in agents/order.json beside
the usage records. The key catcher turns Ctrl+Up/Down into a reorder
only for panels that opt in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Light only an agent's mark when the cursor or a drag is on it

The mark is the handle the agent moves by, so the keyboard cursor and
the drop spot while dragging box it alone rather than the header line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep a lit agent mark's box from being clipped at the panel's edge

The box overhangs the content's left edge, which the scrolling area
clipped. The scrolling area now reaches a little into the panel's
padding with the content shifted back, so nothing moves and the box
draws whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Reuse a Grok session scan only on the day it was made

A limits-only refresh just after midnight reused a scan from the evening
before, which counted yesterday's sessions as today's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep Ctrl+Up/Down from moving an agent when the cursor is outside one

The hero's buttons and the starter tiles carry indices too, and the
lookup read them as accounts, so with several accounts Ctrl+Up/Down on
one of them moved an unrelated agent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Report a failed mise update even after the Grok upkeep runs

The Grok block ran after `mise up` and its last command set the script's
status, so a failed tool update could read as a success to callers that
warn about it. The update's own status is now the script's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Unpack a Grok update into ~/.grok whatever GROK_HOME says

The upkeep replaces ~/.grok's link, but the npm launcher unpacks into
GROK_HOME when it's set, so with a custom home the link never came back
at the new release and the old one was restored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hold off reordering agents while an account name is being edited

Ctrl+Up/Down reached the key catcher during an inline rename, and moving
the agent rebuilt its section, dropping the unfinished name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Install Grok through mise's first-party package

The npm launcher keeps an old ~/.grok/bin binary because mise skips its
postinstall. Use mise's grok tool, and drop the npm tool so its shim
does not stay ahead of the stub.

* Drop the npm Grok workarounds now that mise installs Grok itself

With Grok installed through mise's first-party package, the CLI is the
binary mise manages, so the update upkeep that repointed ~/.grok/bin and
the shared bin directory for added Grok accounts have nothing left to do.
omarchy-update-mise is back to running mise up and nothing else, and
adding a first Grok account installs the same package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Count Grok's tokens and prompts from its usage ledger

Each Grok session keeps a usage.json, the ledger `grok usage` prints, with
every finished turn's end time and tokens by model. The collector now
reads it for tokens today, by day for the last week, and by model, with
cached input kept apart, and counts today's prompts by the turns that
ended today. Found in omacom#12352's research.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Count cache writes in Grok's daily token totals

Grok's totalTokens leaves cache writes out while the per-model buckets
count them, so a turn with cache writes added less to its day than to
its model. The day's total is now the sum of those same buckets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Remove the npm launcher's old Grok binaries when moving to mise's Grok

Omarchy's npm wrapper ran the binary the launcher unpacked into
~/.grok/bin, where x.ai's installer also puts a copy with a PATH entry
ahead of mise. Once the wrapper is replaced, a binary left there would
keep shadowing the mise tool, so the migration removes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Jesse Miller <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

3 participants