Skip to content

agent: document @functools.cache pattern for IO-intensive private helpers in skills#1815

Merged
nathanjmcdougall merged 2 commits into
mainfrom
copilot/cache-private-helpers
Apr 4, 2026
Merged

agent: document @functools.cache pattern for IO-intensive private helpers in skills#1815
nathanjmcdougall merged 2 commits into
mainfrom
copilot/cache-private-helpers

Conversation

Copilot AI commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Agent guidelines lacked explicit instruction to apply @functools.cache to IO-intensive private helpers or to register their .cache_clear() in the conftest fixture — leaving both steps to tribal knowledge.

Changes

  • usethis-python-code skill (v1.6 → v1.7): New "Caching IO-intensive private helpers" section — when to apply @functools.cache (read-only, called multiple times per invocation), the three-step procedure, and common mistakes (caching side-effectful functions, omitting conftest registration).
  • usethis-python-test skill (v1.1 → v1.2): New "Clearing functools caches between tests" section — two-step procedure for importing and registering .cache_clear() in clear_functools_caches, with explanation of why omitting it causes silent test pollution.

Copilot AI self-assigned this Apr 4, 2026
…ate helpers

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/ad1a71e8-94ef-4eca-b9af-32019336542e

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add caching for private helper functions in conftest agent: document @functools.cache pattern for IO-intensive private helpers in skills Apr 4, 2026
Copilot AI requested a review from nathanjmcdougall April 4, 2026 09:31
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review April 4, 2026 17:01
@nathanjmcdougall nathanjmcdougall merged commit 4282401 into main Apr 4, 2026
1 check passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/cache-private-helpers branch April 4, 2026 17:01
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.

agent: cache IO-intensive private helpers with @functools.cache and register in conftest

2 participants