summaryrefslogtreecommitdiff
path: root/tests/opencode
diff options
context:
space:
mode:
authorDrew Ritter <drew@ritter.dev>2026-11-02 12:50:43 -0800
committerGitHub <noreply@github.com>2026-11-02 12:50:43 -0800
commit587f04636d67a32d2edf65550085cdf2d70260a4 (patch)
tree2c81f2d32c54b2abff8b75a54f10741e2df55dd3 /tests/opencode
parent31ac34e181da9a896ac0a7664305416a84ac748e (diff)
parent9e663a0dd87ac082f10f8ee6b46476951be027d1 (diff)
Merge pull request #2600 from obra/fix/2197-opencode-bootstrap-guard
fix(opencode): don't mistake a prompt that mentions EXTREMELY_IMPORTANT for the bootstrap
Diffstat (limited to 'tests/opencode')
-rw-r--r--tests/opencode/test-session-bootstrap.mjs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/opencode/test-session-bootstrap.mjs b/tests/opencode/test-session-bootstrap.mjs
index 31658d5..67b3118 100644
--- a/tests/opencode/test-session-bootstrap.mjs
+++ b/tests/opencode/test-session-bootstrap.mjs
@@ -139,6 +139,16 @@ for (const flavor of ['v1', 'v2']) {
await unknown.invoke(noID);
assert.equal(bootstrapCount(noID), 1);
assert.deepEqual(unknown.lookups, []);
+
+ // #2197: a prompt that merely mentions the bootstrap's tag is not the bootstrap.
+ const mentions = await makeHarness(flavor, (id) => reply(flavor, { id }));
+ const probe = makeEvent(flavor, `${flavor}-mentions-tag`);
+ (probe.messages[0].parts ?? probe.messages[0].content)[0].text =
+ "Is there an 'EXTREMELY_IMPORTANT' block in your context?";
+ await mentions.invoke(probe);
+ assert.equal(bootstrapCount(probe), 1, `${flavor}: prompt mentioning the tag still gets bootstrap`);
+ await mentions.invoke(probe);
+ assert.equal(bootstrapCount(probe), 1, `${flavor}: prompt mentioning the tag, repeated event`);
}
function compactedEvent(sessionID) {