Skip to content

fix(cli): resolve categories through the selected instance - #160

Open
TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/selected-instance-category-rules
Open

TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/selected-instance-category-rules

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Summary

  • Resolve saved categories through the already-selected client in both report and canonical.
  • Allow an optional client in get_classes, retaining standalone construction and defaults for unset, empty or failed settings lookups.
  • Add 40 parameterized regressions covering both real Click callbacks/query builders, explicit endpoints, default endpoint, testing/named-profile selections and helper compatibility.

Closes #159

Reproduction and verification

Authoritative master c88cf12 reproduced three filing-probe failures: report settings targeted the second client, canonical never loaded settings, and canonical omitted the saved custom category. Initial repository tests: 12 failed / 4 passed; repaired and expanded tests: 40 passed.

  • Bounded package make test: 162 passed (6.79s).
  • make typecheck: clean, 31 source files.
  • Ruff check, format check and git diff --check: clean.
  • Filing-time probe against committed repair 0c7cf58: passes both commands.

No make test-fast target exists here; used the bounded package test target (existing exclusions for live-server/interactive tests). Settings/transport are synthetic; actual CLI/query builders run. No private activity or remote server requests and no claim of live AQL classification.

Scope / overlap

Inspected open PRs #138, #145, #147 and #158. #158 independently adds cache-name decorators in the same CLI; this patch changes imports/category lookup only and does not copy its decorators or change cache policy, timezone or output shape. Passing the selected client avoids reconstructing endpoint/auth/config state. Empty settings deliberately retain the existing default fallback rather than introducing new semantics.

Git-Session-Id: 41c87248-7e00-4554-ae97-4d28ae19fb19
Git-Session-Id: 41c87248-7e00-4554-ae97-4d28ae19fb19
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Both CLI commands now load saved categories from the server the user selected.

  • Report and canonical use categories from the instance they query.

Reviews (1) · Last reviewed commit: "fix(cli): resolve categories through the..." · Reviewed by Greptile

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

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.

CLI report and canonical do not consistently use selected-instance category settings

1 participant