Skip to content

feat: make the marker silence clause conditional on visibilityMarkers - #1045

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-20_marker-silent-clause
Sep 20, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-20_marker-silent-clause

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #913

What

MARKER_INTEGRITY_NOTE was one unconditional constant carrying two rules:

With compress.visibilityMarkers: false the proxy stops emitting markers entirely, yet the silence clause kept riding every nudge and the injected compress prompt — an instruction about artifacts that deployment never shows. This is the remaining open decision from #913 (question 2 was deferred when #899 merged).

Change

  • src/compress-tool.ts: constant split into MARKER_INTEGRITY_NOTE (base, unconditional) + MARKER_SILENCE_CLAUSE; withMarkerIntegrityNote(text, visibilityMarkers = true) appends the clause only while markers are visible. Default output is byte-identical to before.
  • src/server.ts: the flag is resolved once per request at the prepare dispatch (resolveCompress(...).visibilityMarkers ?? true, same resolution the compress loop already uses) and threaded through prepareAnthropic / prepareOpenai / prepareGoogle / prepareResponses / injectSystem and the loop's systemPrompt build (const hoisted above its first use) — so first request and loop re-requests agree, per-config byte-stable anchor preserved.
  • Tests: tests/marker-echo.test.ts pins clause dropped at false, 模型把 "📦 [ACP] Compressed" 确认标记伪造为普通 assistant 文本——17 次假压缩、0 次真实执行(自我回执幻觉) #717 base intact, silence clause is a pure suffix append, default-arg legacy equality.
  • Docs: CONFIGURATION.md visibilityMarkers entry + CHANGELOG.

Impact

Pre-flight

  • npm run typecheck ✅
  • npm test — 2071 pass / 0 fail (2 skipped = gated e2e) ✅
  • npm run build ✅

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-20_marker-silent-clause (2bf7170)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-1045

Each push to this PR publishes a new version under the pr-1045 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1045.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit fca10cb into master Sep 20, 2026
8 checks passed
@ranxianglei
ranxianglei deleted the 2026-09-20_marker-silent-clause branch October 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#899 MARKER_INTEGRITY_NOTE 静默条款:是否合并与可配置性

1 participant