php-agentic/tests
darbs-claude a352f697a9
Some checks failed
CI / PHP 8.4 (pull_request) Failing after 1m23s
CI / PHP 8.3 (pull_request) Failing after 1m27s
perf: cache permitted tools per API key (closes #24)
Cache the list of permitted tool names in `AgentToolRegistry::forApiKey()`
using a 1-hour TTL to avoid O(n) filtering on every request (PERF-002).

- Add `Cache::remember()` in `forApiKey()` storing tool names keyed by API
  key ID (`agent_tool_registry:api_key:{id}`)
- Add `flushCacheForApiKey(int|string $id)` for explicit invalidation
- Add `CACHE_TTL` constant (3600 s) for easy tuning
- Invalidate cache in `AgentApiKeyService::updatePermissions()` and `revoke()`
  so permission changes take effect immediately
- Add `tests/Unit/AgentToolRegistryTest.php` covering cache hit/miss,
  per-key isolation, scope filtering, TTL constant, and flush behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 10:54:12 +00:00
..
Feature style: fix pint code style issues 2026-02-23 06:42:24 +00:00
Fixtures test: add Livewire component tests for all 12 admin components 2026-02-23 01:16:33 +00:00
Unit perf: cache permitted tools per API key (closes #24) 2026-02-23 10:54:12 +00:00
UseCase chore: fix pint code style and add test config 2026-02-23 03:50:09 +00:00
views test: add Livewire component tests for all 12 admin components 2026-02-23 01:16:33 +00:00
Pest.php refactor(tests): convert AgentApiKey tests to Pest functional syntax 2026-01-29 18:42:56 +00:00
TestCase.php test: fix TestCase to use Orchestra Testbench for CI 2026-02-23 06:18:30 +00:00