Repository navigation
fix: merge adaptive guidance into first system prompt - #29
Closed
BaconDroid wants to merge 8 commits into
Closed
BaconDroid wants to merge 8 commits into
BaconDroid wants to merge 8 commits into
Conversation
Fix the temporary-reset baseline, read assistant-shaped messages, merge guidance into the first system prompt, and replace Zod config parsing with a small validator.
Add an optional classifier (default opencode/big-pickle) and afterIdle/afterUserMessage triggers for the guidance. The classifier uses the same guidance, the last compaction summary or the current segment, and the current message last. Session state is bounded at 5,000 entries, expires after seven days, and is removed when a session is deleted.
V1 plugin implementations do not run in OpenCode V2 (PluginModule.LoadError),
so the V1 plugin function is replaced with Plugin.define({ id, setup }) and the
hooks are mapped to the V2 domains: ctx.tool.transform (set_reasoning_effort),
ctx.event.subscribe (triggers), and session hooks for the classifier/guidance.
The classifier's per-request level is applied to the real provider request via
event.options and scoped model.request/http.request overrides (mutating
event.model never reaches the request on V2). Temporary tool changes restore
the pre-tool session variant at idle and never undo user model/agent choices.
76 tests; verified on opencode 2.0.30 with wire-level probes.
Port to the OpenCode V2 plugin API
…aration succeeds
Installing this repo as a github: plugin spec runs npm's git-dep
preparation (npm install --force --include=dev inside the clone), which
crashes npm 10.9.9's arborist while walking vitest's optional peer set
('Cannot read properties of null (reading 'edgesOut')'). The plugin then
never loads from a github: spec.
The overrides entry makes arborist materialize the
@vitest/browser-playwright node instead of hitting the null peer walk.
Verified against the exact failing install command.
fix: pin @vitest/browser-playwright via overrides so npm git-dep preparation succeeds
…ascoe#21) Strict chat templates (e.g. llama.cpp) require exactly one system message and reject additional ones, breaking template rendering. Merge the adaptive-thinking guidance into the existing first system prompt instead of pushing a second one; only inject a standalone entry when no system prompt exists yet.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The plugin used
system.push()to inject adaptive-thinking guidance, which createsa second system message. Strict chat templates (e.g. llama.cpp) require exactly one
system message at the beginning of the conversation and reject additional ones,
breaking template rendering before inference starts.
Fix
Merge the adaptive-thinking guidance into the existing first system prompt instead
of pushing a second one. Only inject a standalone entry when no system prompt exists
yet.
This mirrors the fix from PR #21 by @zoomdbz with adjustments for our V2 plugin API.
Changes
Before:
After:
Verification
tsc --noEmitpasses cleanbun run build:pluginsucceeds