summaryrefslogtreecommitdiff
path: root/tests/opencode
diff options
context:
space:
mode:
authorDrew Ritter <drew@primeradiant.com>2026-05-13 17:29:04 -0700
committerDrew Ritter <drew@primeradiant.com>2026-06-16 10:09:43 -0700
commitf030d6ef88ae28946184d87f7d339743da757651 (patch)
tree58f348fd4634b3663c368d9690b89c5fd13ec78b /tests/opencode
parentd7f47d350a5fb53014af8bd707420c811f82ac1f (diff)
Tighten cross-platform tool references
Diffstat (limited to 'tests/opencode')
-rw-r--r--tests/opencode/test-bootstrap-caching.mjs22
1 files changed, 22 insertions, 0 deletions
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;
}