Skip to content

Cache resource service accessors#8

Merged
terjekv merged 1 commit into
mainfrom
agent/cache-service-accessors
Jul 25, 2026
Merged

Cache resource service accessors#8
terjekv merged 1 commit into
mainfrom
agent/cache-service-accessors

Conversation

@terjekv

@terjekv terjekv commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Why

Every access to a fixed service property such as client.classes, client.groups, or client.tasks currently allocates a new wrapper around the same client. Normal workflows access these properties repeatedly, creating short-lived objects without changing behavior.

What changed

  • lazily cache each fixed resource-service accessor on Client and AsyncClient
  • preserve sync/async parity and stable service identity per client
  • keep class selectors and class-scoped object services on demand through client.classes.by_id(class_id).objects
  • add regression coverage for laziness, reuse, per-client isolation, and class-scoped factory behavior
  • document service lifetimes and update the unreleased changelog

Verification

  • uv sync --extra dev
  • uv run ruff format --check .
  • uv run ruff check .
  • uv run mypy
  • uv run bandit -q -r src scripts
  • uv run zizmor .
  • uv run pytest --cov — 327 passed, 99.05% coverage
  • uv run mkdocs build --strict
  • uv build

The pinned Hubuum v0.0.3 e2e workflow in CI remains the live compatibility authority for this PR.

@terjekv
terjekv force-pushed the agent/cache-service-accessors branch from 9aca45f to b24de2a Compare July 25, 2026 00:44
@terjekv
terjekv marked this pull request as ready for review July 25, 2026 00:45
@terjekv
terjekv merged commit 5d6fbf0 into main Jul 25, 2026
7 checks passed
@terjekv
terjekv deleted the agent/cache-service-accessors branch July 25, 2026 00:46
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.

1 participant