p66
This commit is contained in:
@@ -92,6 +92,7 @@ parameters:
|
||||
shop_query_optimization_heartbeat: Shop-Suchanfrage wird optimiert…
|
||||
generic_internal_error: ❌ Bei der Verarbeitung der Anfrage ist ein interner Fehler aufgetreten.
|
||||
debug_internal_error_prefix: '❌ Interner Fehler: '
|
||||
technical_error_detail_template: '<br><small>Technischer Fehler: {message}</small>'
|
||||
final_answer_guard:
|
||||
truncation_message: |2-
|
||||
|
||||
@@ -231,6 +232,7 @@ parameters:
|
||||
shop_meta_result_count: 'Shoptreffer: {count}'
|
||||
history_notice_without_detail: 'Systemhinweis: {title}.'
|
||||
history_notice_with_detail: 'Systemhinweis: {title}. Ursache: {detail}'
|
||||
history_response_system_notice: 'Systemhinweis: {message}'
|
||||
follow_up_actions:
|
||||
commerce:
|
||||
- label: Im Shop suchen
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# RetrieX Patch 66 - Chat Message Residual Cleanup
|
||||
|
||||
## Ziel
|
||||
|
||||
p66 schliesst die Chat-Messages-Migration nach p63, p64 und p65 ab, indem zwei verbliebene user-lesbare Resttexte aus `AgentRunner.php` nach `config/retriex/chat-messages.yaml` verschoben werden.
|
||||
|
||||
## Geaenderte Dateien
|
||||
|
||||
- `config/retriex/chat-messages.yaml`
|
||||
- neuer Key `agent.messages.technical_error_detail_template`
|
||||
- neuer Key `agent.production_ui.templates.history_response_system_notice`
|
||||
- `src/Config/ChatMessagesConfig.php`
|
||||
- Validation der neuen Chat-Message-Keys
|
||||
- `src/Config/AgentRunnerConfig.php`
|
||||
- neue Getter fuer die beiden Rest-Templates
|
||||
- neue chat-only Zugriffsmethode fuer neue Keys ohne Legacy-Agent-Fallback
|
||||
- `src/Agent/AgentRunner.php`
|
||||
- History-Fallback-Systemhinweis rendert ueber YAML-Template
|
||||
- technischer Fehlerdetail-Hinweis rendert ueber YAML-Template
|
||||
|
||||
## Bewusst nicht geaendert
|
||||
|
||||
- keine Aenderung an Retrieval
|
||||
- keine Aenderung an Scoring oder Ranking
|
||||
- keine Aenderung an Intent- oder Shop-Matching
|
||||
- keine Aenderung an `AgentRunner.php`-Ablauflogik ausser der Message-Template-Herkunft
|
||||
- keine neuen chat-sichtbaren Legacy-Keys in `agent.yaml`
|
||||
|
||||
## Ergebnis
|
||||
|
||||
Nach p66 liegen die bekannten user-lesbaren Chat-/SSE-/Frontend-/Agent-Messages zentral in `config/retriex/chat-messages.yaml`.
|
||||
|
||||
## Lokale Checks
|
||||
|
||||
Gruen:
|
||||
|
||||
```bash
|
||||
php -l src/Config/ChatMessagesConfig.php
|
||||
php -l src/Config/AgentRunnerConfig.php
|
||||
php -l src/Agent/AgentRunner.php
|
||||
python3 -c "import yaml; yaml.safe_load(open('config/retriex/chat-messages.yaml'))"
|
||||
php /tmp/p66_smoke.php
|
||||
php /tmp/p66_agent_config_smoke.php
|
||||
```
|
||||
|
||||
Nicht lokal ausfuehrbar im ZIP ohne `vendor/`:
|
||||
|
||||
```bash
|
||||
php bin/console mto:agent:config:validate
|
||||
```
|
||||
|
||||
Fehler:
|
||||
|
||||
```text
|
||||
Dependencies are missing. Try running "composer install".
|
||||
```
|
||||
@@ -4516,7 +4516,10 @@ final readonly class AgentRunner
|
||||
$noLlmMessage = $this->agentRunnerConfig->getProductionUiText('no_llm_history_default');
|
||||
}
|
||||
|
||||
$parts[] = 'Systemhinweis: ' . $noLlmMessage;
|
||||
$parts[] = $this->renderAgentTemplate(
|
||||
$this->agentRunnerConfig->getHistoryResponseSystemNoticeTemplate(),
|
||||
['message' => $noLlmMessage]
|
||||
);
|
||||
}
|
||||
|
||||
return trim(implode("\n\n", $parts));
|
||||
@@ -5015,7 +5018,10 @@ final readonly class AgentRunner
|
||||
|
||||
if (!$this->debug) {
|
||||
return $this->agentRunnerConfig->getGenericInternalErrorMessage()
|
||||
. '<br><small>Technischer Fehler: ' . $safeMessage . '</small>';
|
||||
. $this->renderAgentTemplate(
|
||||
$this->agentRunnerConfig->getTechnicalErrorDetailTemplate(),
|
||||
['message' => $safeMessage]
|
||||
);
|
||||
}
|
||||
|
||||
return $this->agentRunnerConfig->getDebugInternalErrorPrefix()
|
||||
|
||||
@@ -386,6 +386,15 @@ final class AgentRunnerConfig
|
||||
return $this->getRequiredString($legacyKey);
|
||||
}
|
||||
|
||||
private function getChatOnlyRequiredString(string $chatKey): string
|
||||
{
|
||||
if ($this->chatMessages === null) {
|
||||
throw new \InvalidArgumentException(sprintf('RetrieX chat messages config key "%s" is required.', $chatKey));
|
||||
}
|
||||
|
||||
return $this->chatMessages->getString($chatKey);
|
||||
}
|
||||
|
||||
private function getChatStringAllowEmpty(string $chatKey, string $legacyKey): string
|
||||
{
|
||||
if ($this->chatMessages !== null) {
|
||||
@@ -1045,6 +1054,16 @@ final class AgentRunnerConfig
|
||||
return $this->getChatRequiredString('agent.messages.debug_internal_error_prefix', 'messages.debug_internal_error_prefix');
|
||||
}
|
||||
|
||||
public function getTechnicalErrorDetailTemplate(): string
|
||||
{
|
||||
return $this->getChatOnlyRequiredString('agent.messages.technical_error_detail_template');
|
||||
}
|
||||
|
||||
public function getHistoryResponseSystemNoticeTemplate(): string
|
||||
{
|
||||
return $this->getChatOnlyRequiredString('agent.production_ui.templates.history_response_system_notice');
|
||||
}
|
||||
|
||||
public function getExternalUrlSourceLabel(): string
|
||||
{
|
||||
return $this->getChatRequiredString('agent.source_labels.external_url', 'source_labels.external_url');
|
||||
|
||||
@@ -298,6 +298,7 @@ final class ChatMessagesConfig
|
||||
'agent.messages.shop_query_optimization_heartbeat',
|
||||
'agent.messages.generic_internal_error',
|
||||
'agent.messages.debug_internal_error_prefix',
|
||||
'agent.messages.technical_error_detail_template',
|
||||
'agent.final_answer_guard.truncation_message',
|
||||
'agent.no_llm_fallback.messages.shop_only',
|
||||
'agent.no_llm_fallback.messages.shop_with_knowledge',
|
||||
@@ -419,6 +420,7 @@ final class ChatMessagesConfig
|
||||
'agent.production_ui.templates.shop_meta_result_count',
|
||||
'agent.production_ui.templates.history_notice_without_detail',
|
||||
'agent.production_ui.templates.history_notice_with_detail',
|
||||
'agent.production_ui.templates.history_response_system_notice',
|
||||
'agent.source_labels.external_url',
|
||||
'agent.source_labels.rag_knowledge',
|
||||
'agent.source_labels.conversation_history',
|
||||
|
||||
Reference in New Issue
Block a user