harden runner fullcontext

This commit is contained in:
team2
2026-02-16 22:54:52 +01:00
parent 34e3d8139e
commit da17fbc501
3 changed files with 6 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ final readonly class AgentRunner
{
}
public function run(string $prompt, string $userId): Generator
public function run(string $prompt, string $userId, ?bool $includeFullContext = false): Generator
{
$prompt = trim($prompt);
@@ -47,7 +47,7 @@ final readonly class AgentRunner
// ---------------------------------------------------------
// 1) Context strategy
// ---------------------------------------------------------
$includeFullContext = false;
//$includeFullContext = false;
// ---------------------------------------------------------
// 2) Extract URL content (if present)

View File

@@ -32,7 +32,7 @@ final readonly class PromptBuilder
string $userId,
string $urlContent,
array $knowledgeChunks,
bool $fullContext = false,
?bool $fullContext = false,
): string
{
$now = (new DateTimeImmutable())->format('Y-m-d H:i:s');
@@ -47,7 +47,8 @@ final readonly class PromptBuilder
throw new \RuntimeException('No active system prompt configured.');
}
$systemBlock = "SYSTEM:\n" . $activePrompt->getContent();
$activeSystemPrompt = str_replace('{%now%}', $now, $activePrompt->getContent());
$systemBlock = "SYSTEM:\n" . $activeSystemPrompt;
// ------------------------------------------------------------
// 2) CONVERSATION CONTEXT (AUTHORITATIVE)