Add "hello" tests to VS Code smoke tests (#319719)

* Add "hello" tests to VS Code smoke tests

* Address CCR feedback
This commit is contained in:
Alex Ross authored and GitHub committed 2026-06-03 15:29:51 +02:00
1 parent d67410c302
commit 616eab07e3
6 files changed
+220 -7

No files matched your search

@@ -995,6 +995,24 @@ async function handleMessagesApi(body, res) {
break;
}
}
// Anthropic's Messages API also accepts a top-level `system` parameter
// (string or array of `{ type: 'text', text }` blocks). Some session
// types (e.g. Claude Code) embed the user prompt there alongside the
// system instructions, so scan it as a fallback when no tag was found
// in the messages array.
if (!isScenarioRequest && parsed.system !== undefined) {
const systemContent = typeof parsed.system === 'string'
? parsed.system
: Array.isArray(parsed.system)
? parsed.system.map((/** @type {any} */ c) => c.text || '').join('')
: '';
const match = systemContent.match(/\[scenario:([^\]]+)\]/);
if (match && SCENARIOS[match[1]]) {
scenarioId = match[1];
isScenarioRequest = true;
}
}
} catch { }
const scenario = SCENARIOS[scenarioId] || SCENARIOS[DEFAULT_SCENARIO];