Proof Portal
Omarchy
ProbeLabs65 findings · 95 requirementsA proof layer — requirements, tests and verified fixes — for two of Omarchy's subsystems: the application menu (launcher scripts, QML model, JSONC config, search and selection) and the lock screen (lock scripts, QML, PAM authentication). Scope is deliberately limited to those components of omacom/omarchy; the rest of the distribution is not covered.
Agents widget ignores Anthropic usage from opencode v2 (only reads legacy `message` table)
Reported by brsnippe · filed Sep 30, 2026Closed upstream on 2026-10-02 by its own reporter brsnippe. GitHub close reason: completed. Closed by its own reporter — not by itself evidence of a fix.
At a glance
- 1 · What is claimed?
- Only the report text below — no validator has restated it as checkable claims yet.
- 2 · What does it affect?
- Not yet mapped to any requirement or component.
- 3 · Is it reproducible?
- No validation has been run yet.
- 4 · What remains unclear?
- Not validated yet: no claims, no reproducer.
- 5 · What happens next?
- Our staff decide whether the report is valid. Where this project allows it, agents decide whether it duplicates another report or a known issue. No decision has been recorded yet.
Original report
System details
Intel i7-1260P, Intel Iris Xe (Alder Lake-P), Omarchy 4.0.4-1, opencode v2.0.20
What's wrong?
omarchy-agent-usage-claude is meant to count Claude usage from opencode sessions on the anthropic provider (scan_opencode_usage). With opencode v2 none of it gets counted: the Claude record shows no opencode tokens, even after omarchy agent usage update --force.
Cause
scan_opencode_usage only reads the legacy v1 table and expects the v1 row shape (data.role == "assistant", top-level data.providerID / data.modelID):
conn.execute("SELECT session_id, data FROM message")opencode v2 writes messages to session_message instead, and the shape is different:
- The role is in the
typecolumn ('assistant'), not indata.role. - Provider and model are nested:
data.model.providerIDanddata.model.id(plusvariant). data.tokenshas the same shape as before (input,output,reasoning,cache.read,cache.write), anddata.time.createdis still in ms.
Example session_message.data for an assistant row (with content removed):
{
"model": { "id": "claude-opus-5-5", "providerID": "anthropic", "variant": "xhigh" },
"tokens": { "input": 4, "output": 96, "reasoning": 775, "cache": { "read": 0, "write": 50180 } },
"time": { "created": 1790787150779, "streamed": 1790787167692, "completed": 1790787171768 }
}In ~/.local/share/opencode/opencode.db on this machine:
message(legacy): 67 rows, none of them onanthropic, so the scan finds nothing.session_message(v2): 20 assistant rows onanthropic/claude-opus-5-5(~1.14M cache-read, ~72K cache-write, ~5.4K output and ~3.2K reasoning tokens). None of these show up in the panel.
session_v2 also has per-session totals (tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, tokens_cache_write) and a model JSON column, if those are easier to use.
Steps to reproduce
- Use opencode v2 with the Anthropic provider (Claude subscription login) for a few prompts.
- Run
omarchy agent usage update --force. - Open the Agents panel, or look at
~/.local/state/omarchy/agents/usage/claude.json. None of the opencode tokens appear under "Tokens by day" or "Tokens by model", and they aren't included intotalPrompts.
Expected
opencode v2 Anthropic messages are counted the same way v1 messages are.
Side effect: if opencode v2 is the only Claude client in use and Claude Code's own sign-in has lapsed (so there are no limits), the Claude record has no data at all and the Agents icon disappears from the bar completely.
Possible fix
Also read session_message when it exists (WHERE type = 'assistant', provider from data.model.providerID, model from data.model.id). Keep the message scan for v1 databases.
Checked against master: bin/omarchy-agent-usage-claude still only queries FROM message (line 476).
View raw text
### System details
Intel i7-1260P, Intel Iris Xe (Alder Lake-P), Omarchy 4.0.4-1, opencode v2.0.20
### What's wrong?
`omarchy-agent-usage-claude` is meant to count Claude usage from opencode sessions on the `anthropic` provider (`scan_opencode_usage`). With **opencode v2** none of it gets counted: the Claude record shows no opencode tokens, even after `omarchy agent usage update --force`.
**Cause**
`scan_opencode_usage` only reads the legacy v1 table and expects the v1 row shape (`data.role == "assistant"`, top-level `data.providerID` / `data.modelID`):
```python
conn.execute("SELECT session_id, data FROM message")
```
opencode v2 writes messages to `session_message` instead, and the shape is different:
- The role is in the `type` column (`'assistant'`), not in `data.role`.
- Provider and model are nested: `data.model.providerID` and `data.model.id` (plus `variant`).
- `data.tokens` has the same shape as before (`input`, `output`, `reasoning`, `cache.read`, `cache.write`), and `data.time.created` is still in ms.
Example `session_message.data` for an assistant row (with `content` removed):
```json
{
"model": { "id": "claude-opus-5-5", "providerID": "anthropic", "variant": "xhigh" },
"tokens": { "input": 4, "output": 96, "reasoning": 775, "cache": { "read": 0, "write": 50180 } },
"time": { "created": 1790787150779, "streamed": 1790787167692, "completed": 1790787171768 }
}
```
In `~/.local/share/opencode/opencode.db` on this machine:
- `message` (legacy): 67 rows, none of them on `anthropic`, so the scan finds nothing.
- `session_message` (v2): 20 assistant rows on `anthropic` / `claude-opus-5-5` (~1.14M cache-read, ~72K cache-write, ~5.4K output and ~3.2K reasoning tokens). None of these show up in the panel.
`session_v2` also has per-session totals (`tokens_input`, `tokens_output`, `tokens_reasoning`, `tokens_cache_read`, `tokens_cache_write`) and a `model` JSON column, if those are easier to use.
**Steps to reproduce**
1. Use opencode v2 with the Anthropic provider (Claude subscription login) for a few prompts.
2. Run `omarchy agent usage update --force`.
3. Open the Agents panel, or look at `~/.local/state/omarchy/agents/usage/claude.json`. None of the opencode tokens appear under "Tokens by day" or "Tokens by model", and they aren't included in `totalPrompts`.
**Expected**
opencode v2 Anthropic messages are counted the same way v1 messages are.
Side effect: if opencode v2 is the only Claude client in use and Claude Code's own sign-in has lapsed (so there are no limits), the Claude record has no data at all and the Agents icon disappears from the bar completely.
**Possible fix**
Also read `session_message` when it exists (`WHERE type = 'assistant'`, provider from `data.model.providerID`, model from `data.model.id`). Keep the `message` scan for v1 databases.
Checked against `master`: `bin/omarchy-agent-usage-claude` still only queries `FROM message` (line 476).
Validation
Not checked yet. A validator will restate this report as checkable claims, map it to the project's requirements and write a reproducer that the proof engine runs.
Linked
Not linked to any known issue, other report or change yet.
Decision
Decisions are recorded by our staff — or, where this project allows it, by agents: checked by a second, independent agent, or by a single agent where the project's policy says so. Any decision reached so far is shown below.
No decision has been recorded yet.