diff --git a/Jobs/ProcessContentTask.php b/Jobs/ProcessContentTask.php index ddb4b17..840dce4 100644 --- a/Jobs/ProcessContentTask.php +++ b/Jobs/ProcessContentTask.php @@ -111,10 +111,12 @@ class ProcessContentTask implements ShouldQueue private function interpolateVariables(string $template, array $data): string { foreach ($data as $key => $value) { + $placeholder = '{{{' . $key . '}}}'; + if (is_string($value)) { - $template = str_replace("{{{$key}}}", $value, $template); + $template = str_replace($placeholder, $value, $template); } elseif (is_array($value)) { - $template = str_replace("{{{$key}}}", json_encode($value), $template); + $template = str_replace($placeholder, json_encode($value), $template); } } diff --git a/tests/Unit/AgentToolRegistryTest.php b/tests/Unit/AgentToolRegistryTest.php index 29f3636..668f563 100644 --- a/tests/Unit/AgentToolRegistryTest.php +++ b/tests/Unit/AgentToolRegistryTest.php @@ -105,7 +105,7 @@ function makeApiKey(int $id, array $scopes = [], ?array $toolScopes = null): Api describe('forApiKey caching', function () { beforeEach(function () { - Cache::fake(); + Cache::flush(); }); it('returns the correct tools on first call (cache miss)', function () { @@ -213,7 +213,7 @@ describe('cache TTL', function () { }); it('stores entries in cache after first call', function () { - Cache::fake(); + Cache::flush(); $registry = new AgentToolRegistry; $registry->register(makeTool('plan.create', [])); @@ -231,7 +231,7 @@ describe('cache TTL', function () { describe('flushCacheForApiKey', function () { beforeEach(function () { - Cache::fake(); + Cache::flush(); }); it('removes the cached entry for the given key id', function () {