Skip to content

fix(model-usage): suppress log spam when optional Claude files are missing - #6504

Closed
shrijit37 wants to merge 1 commit into
omacom:quattrofrom
shrijit37:fix-claude-credentials-log-spam
Closed

shrijit37 wants to merge 1 commit into
omacom:quattrofrom
shrijit37:fix-claude-credentials-log-spam

Conversation

@shrijit37

Copy link
Copy Markdown
Contributor

Summary

When using the model-usage plugin without optional Claude credentials or history files, Claude.qml logs console.error("model-usage/claude", "credentials.json not found at...") and Qt logs WARN scene: QML FileView ... File does not exist every 15 minutes continuously.

Fix

Set printErrors: false on the FileView components and avoid logging console.error for expected FileViewError.FileNotFound errors when optional credentials or history files are missing.

…are missing

- Set printErrors: false on historyFile and credentialsFile FileViews.
- Don't log console.error when history.jsonl or credentials.json fail with FileNotFound (missing optional files).
Copilot AI review requested due to automatic review settings August 2, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Suppresses expected log noise when optional Claude usage files are absent.

Changes:

  • Disables automatic FileView error printing.
  • Logs only unexpected file-loading failures.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhh

dhh commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Heads up: #6603 just landed on quattro and restructured this whole area, so this PR needs a rework before it can merge.

The model-usage plugin is gone. It's been renamed to omarchy.agents (shell/plugins/agents/), and the panel is now strictly a display: it watches JSON records under ~/.local/state/omarchy/agents/usage/ and draws whatever appears there. All the in-plugin machinery this PR touches — providers/*.qml adapters and scripts/*_usage_scanner.py — no longer exists.

Usage collection now lives in standalone collectors in bin/. One omarchy-agent-usage-<agent> script per agent prints a complete, display-ready usage record (identity, tier, status, rate limits, today/week/all-time stats), and omarchy-agent-usage-update runs every collector it finds and writes the records atomically to the state directory.

The upside: adding an agent no longer touches the panel at all. Ship a collector that prints the record contract, optionally add an assets/<id>.svg mark (with an -light twin if it needs one for light surfaces), and the panel gains a tab on its own. See shell/plugins/agents/README.md for the contract and the claude/codex collectors in bin/ as reference implementations — #6604 (Cursor) is a good example of a provider PR in the new style.

If you'd like to carry this forward, rebase on quattro and rework it against the new omarchy.agents panel — the change may look quite different there, or may already be moot. Happy to answer questions here.

— Claude Fable 5, written on behalf of @dhh

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed this against current quattro (3faafba). The bug it fixes no longer exists there, so there is nothing left to rework.

  • The only file this PR edits, shell/plugins/model-usage/providers/Claude.qml, was deleted in Split agent usage into data files and rename the plugin to omarchy.agents #6603 when the plugin became omarchy.agents. That is why GitHub reports a conflict.
  • In the new design the panel never opens ~/.claude/.credentials.json or ~/.claude/history.jsonl. It only reads the usage records under ~/.local/state/omarchy/agents/usage/, and the FileView it uses for them already has printErrors: false and logs nothing when one is missing (shell/plugins/agents/Agent.qml).
  • The collector that does read the Claude files, bin/omarchy-agent-usage-claude, treats a missing history file as zero prompts and a missing credentials file as "not signed in", and prints nothing to stderr in either case.

I checked this on a disposable Omarchy VM: with no ~/.claude directory at all, the quattro versions of omarchy-agent-usage-claude, omarchy-agent-usage-codex and omarchy-agent-usage-update all exited 0 with empty stderr. The code on this branch was not run, because it cannot be applied to quattro.

Codex (medium effort) gave a second opinion. It reached the same conclusion from the source and additionally forced a file-not-found error in the credentials, history and stats-cache readers, all of which stayed silent. It read the same tree, so its agreement is not guaranteed to be independent.

Nothing is needed from you. Closing this PR is up to you or the maintainer.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @shrijit37. #6603 removed the file this edits, so the log spam it fixed can no longer happen.

Closed at the maintainer's request. The review above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

@omarchybot omarchybot closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants