Repository navigation
fix(#451): restore plugin-mode nudge injection + honest diagNudge log - #456
Merged
Merged
Conversation
0.1.69 (225ceb4) gated all three nudge injection sites by !pluginMode on the premise that "in plugin mode the agent owns compression". The agent plugins (pi/omp) are pure protocol clients with NO nudge channel of their own, so the gate silently disabled proactive compression in plugin mode — leaving only preflight at the hard limit — while diagNudge kept logging "INJECT" (the log lied about delivery, same class as #413). - Drop !pluginMode from the anthropic/openai/responses nudge gates. The nudge is an ephemeral trailing user message (not persisted, never enters the agent's re-sent history, prefix-cache-anchor safe), so it belongs in BOTH modes. Tool injection stays gated by !pluginMode (the agent provides tools). - diagNudge now takes the actual willInject decision and prints INJECT only when the nudge truly reaches the upstream payload, else ARMED-SUPPRESSED. - README two-modes table: split the tools/nudge row (tools = none in plugin mode, nudge = yes in both modes). - tests/plugin-nudge-injection.test.ts: regression guard asserting the nudge is a trailing user message in BOTH proxy and plugin mode when armed (verified to fail 30!==31 against the old gate). typecheck / test(901) / build green.
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-456Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr456.tgz
npm install -g packageThis comment is automatically updated on each push. |
This was referenced Sep 2, 2026
Merged
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.
What
Restores proactive nudge injection in plugin mode (regression introduced in 0.1.69 / commit
225ceb4) and makes thediagNudgelog honest about delivery.Root cause
225ceb4gated all three nudge injection sites (prepareAnthropic/prepareOpenai/prepareResponses) with!pluginMode, on the premise that "in plugin mode the agent owns compression". That premise is wrong: the agent plugins (src/agent/pi.ts,src/agent/omp.ts) are pure protocol clients with no nudge channel — they register the 4 ACP tools and forward executions, nothing more. So the gate silently disabled the only proactive trigger in plugin mode, leaving compression to fire solely via preflight at the hard limit (the whole 198k→262k band went naked). MeanwhilediagNudgekept loggingINJECT, so the log lied about delivery (same class as #413).Fix
!pluginModefrom the three nudge gates. The nudge is an ephemeral trailing user message — not persisted, never enters the agent's re-sent history, prefix-cache-anchor safe — so it belongs in both modes. Tool injection stays gated by!pluginMode(the agent provides the tools).diagNudgenow takes the actualwillInjectdecision and printsINJECTonly when the nudge truly reaches the upstream payload; otherwiseARMED-SUPPRESSED. The log no longer lies.tests/plugin-nudge-injection.test.tsasserts the nudge is a trailing user message in both proxy and plugin mode when armed. Verified it fails30 !== 31against the old gate.Out of scope (reported separately)
Issue #451 also noted assistant messages leaking
<acp…>tags into the client TUI (pre-existing since 0.1.68). There is an outbound tag-echo filter (src/loop/tag-echo-filter.ts), so "outbound doesn't strip" needs its own investigation — filed separately to keep this PR focused on the regression.Pre-flight
npm run typecheck✅npm test→ 901 pass / 0 fail ✅ (was 899; +2 new)npm run build✅Fixes #451.