prep(proxy): System-Prompt fuer echten CLI-Kanal separat bereitstellen

Vorbereitung fuer die saubere Variante: ARIA-Persona ueber den ECHTEN
System-Prompt-Kanal der Claude-CLI (--append-system-prompt) zustellen statt als
<system>-getaggten User-Content (den das Modell als Prompt-Injection wertet und
der ARIA aus der Rolle wirft — siehe a0e8c23).

- openai-to-cli.js: extractSystemPrompt() (System-Messages + Tool-Block als
  roher Text, ohne <system>-Tags) und conversationToPrompt() (nur Verlauf).
  openaiToCli() liefert jetzt zusaetzlich systemPrompt + conversationPrompt.
- routes.js: reicht systemPrompt an subprocess.start(..) durch.

BEWUSST rueckwaertskompatibel/no-op: prompt bleibt unveraendert (System-Inhalt
noch drin), die Extra-Option wird von einem ungepatchten manager.js ignoriert.
Der letzte Schritt (manager.js: --append-system-prompt beim Spawn + prompt auf
conversationPrompt umstellen) folgt, sobald die echte manager.js-Struktur
vorliegt — die npm-Datei liegt nicht im Repo und ein Fehlpatch legt den
kompletten Proxy lahm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 20:43:36 +02:00
co-authored by Claude Opus 4.8
parent a0e8c23710
commit b9150f2b46
2 changed files with 77 additions and 0 deletions
+6
View File
@@ -355,6 +355,10 @@ async function handleStreamingResponse(req, res, subprocess, cliInput, requestId
subprocess.start(cliInput.prompt, {
model: cliInput.model,
sessionId: cliInput.sessionId,
// ARIA: echter System-Prompt-Kanal — manager.js reicht das (sobald
// gepatcht) als --append-system-prompt an die CLI. Aktuell ignoriert
// ein ungepatchter manager diese Extra-Option gefahrlos.
systemPrompt: cliInput.systemPrompt,
}).catch((err) => {
console.error("[Streaming] Subprocess start error:", err);
reject(err);
@@ -422,6 +426,8 @@ async function handleNonStreamingResponse(res, subprocess, cliInput, requestId)
.start(cliInput.prompt, {
model: cliInput.model,
sessionId: cliInput.sessionId,
// ARIA: echter System-Prompt-Kanal (siehe Streaming-Branch).
systemPrompt: cliInput.systemPrompt,
})
.catch((error) => {
res.status(500).json({