diff --git a/Services/ContentService.php b/Services/ContentService.php index b906d05..af20506 100644 --- a/Services/ContentService.php +++ b/Services/ContentService.php @@ -172,11 +172,13 @@ class ContentService if ($progress !== null) { $progress['articles'][$slug]['status'] = 'skipped'; } + continue; } if ($dryRun) { $results['articles'][$slug] = ['status' => 'would_generate', 'path' => $draftPath]; + continue; } @@ -184,6 +186,7 @@ class ContentService if (($progress['articles'][$slug]['status'] ?? 'pending') === 'generated') { $results['articles'][$slug] = ['status' => 'skipped', 'reason' => 'previously generated']; $results['skipped']++; + continue; } diff --git a/tests/Unit/AgentToolRegistryTest.php b/tests/Unit/AgentToolRegistryTest.php index 58d559c..29f3636 100644 --- a/tests/Unit/AgentToolRegistryTest.php +++ b/tests/Unit/AgentToolRegistryTest.php @@ -31,12 +31,35 @@ function makeTool(string $name, array $scopes = [], string $category = 'test'): private readonly string $toolCategory, ) {} - public function name(): string { return $this->toolName; } - public function description(): string { return 'Test tool'; } - public function inputSchema(): array { return []; } - public function handle(array $args, array $context = []): array { return ['success' => true]; } - public function requiredScopes(): array { return $this->toolScopes; } - public function category(): string { return $this->toolCategory; } + public function name(): string + { + return $this->toolName; + } + + public function description(): string + { + return 'Test tool'; + } + + public function inputSchema(): array + { + return []; + } + + public function handle(array $args, array $context = []): array + { + return ['success' => true]; + } + + public function requiredScopes(): array + { + return $this->toolScopes; + } + + public function category(): string + { + return $this->toolCategory; + } }; } @@ -51,6 +74,7 @@ function makeApiKey(int $id, array $scopes = [], ?array $toolScopes = null): Api $key = new class($id, $scopes, $toolScopes) extends ApiKey { private int $keyId; + private array $keyScopes; public function __construct(int $id, array $scopes, ?array $toolScopes) @@ -61,7 +85,10 @@ function makeApiKey(int $id, array $scopes = [], ?array $toolScopes = null): Api $this->attributes['tool_scopes'] = $toolScopes; } - public function getKey(): mixed { return $this->keyId; } + public function getKey(): mixed + { + return $this->keyId; + } public function hasScope(string $scope): bool { @@ -113,7 +140,7 @@ describe('forApiKey caching', function () { $apiKey = makeApiKey(1, ['plans.write']); - $first = $registry->forApiKey($apiKey)->keys()->all(); + $first = $registry->forApiKey($apiKey)->keys()->all(); $second = $registry->forApiKey($apiKey)->keys()->all(); expect($second)->toBe($first);