From f030d6ef88ae28946184d87f7d339743da757651 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 13 May 2026 17:29:04 -0700 Subject: Tighten cross-platform tool references --- tests/opencode/test-bootstrap-caching.mjs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/opencode') diff --git a/tests/opencode/test-bootstrap-caching.mjs b/tests/opencode/test-bootstrap-caching.mjs index 55c4e9e..32149ae 100644 --- a/tests/opencode/test-bootstrap-caching.mjs +++ b/tests/opencode/test-bootstrap-caching.mjs @@ -44,6 +44,10 @@ const result = { scenario, firstBootstrapParts: countBootstrapParts(firstOutput), secondBootstrapParts: countBootstrapParts(secondOutput), + staleMentionMapping: bootstrapText(firstOutput).includes('@mention'), + staleTaskMapping: bootstrapText(firstOutput).includes('`Task` tool with subagents'), + mapsSubagentToTask: bootstrapText(firstOutput).includes('`task` with `subagent_type: "general"`'), + mapsMutationToApplyPatch: bootstrapText(firstOutput).includes('`apply_patch`'), firstReadCount: afterFirst.readCount, secondReadCount: afterSecond.readCount, firstExistsCount: afterFirst.existsCount, @@ -83,6 +87,12 @@ function countBootstrapParts(output) { ).length; } +function bootstrapText(output) { + return output.messages[0].parts.find( + (part) => part.type === 'text' && part.text.includes('EXTREMELY_IMPORTANT') + )?.text || ''; +} + function assertPresentBootstrap(result) { const failures = []; if (result.firstBootstrapParts !== 1) { @@ -100,6 +110,18 @@ function assertPresentBootstrap(result) { if (result.secondExistsCount !== result.firstExistsCount) { failures.push(`expected cached second transform to do no additional exists checks, got ${result.secondExistsCount - result.firstExistsCount}`); } + if (result.staleMentionMapping) { + failures.push('expected OpenCode bootstrap not to teach @mention subagent syntax'); + } + if (result.staleTaskMapping) { + failures.push('expected OpenCode bootstrap not to teach stale Task-tool mapping'); + } + if (!result.mapsSubagentToTask) { + failures.push('expected OpenCode bootstrap to map general-purpose subagents to task with subagent_type'); + } + if (!result.mapsMutationToApplyPatch) { + failures.push('expected OpenCode bootstrap to map file mutation to apply_patch'); + } return failures; } -- cgit