Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d86082e
fix: pass Claude Code's MCP config as --mcp-config=<file> so it canno…
MohammadErfan-Jabbari Nov 13, 2026
dfc1a29
fix: retry context overflow with measured output headroom
zouzh22 Nov 13, 2026
99966e2
fix: un-show a nudge whose request the upstream rejected
MohammadErfan-Jabbari Nov 13, 2026
2a355a6
Guard the google lane against inert-frame tail drains
tinysunspot Nov 13, 2026
4383684
Make a held head dropped at drain auditable (#5192)
tinysunspot Nov 13, 2026
9c6e9b3
fix: route relay output-budget helpers via budget.js to keep the side…
Nov 13, 2026
03c6915
test(loop): pin faithful forwarding of model-emitted calls after acp_…
sx4im Nov 13, 2026
296e2c0
fix: extend drain-drop auditability to swallow-span EOF drops
Nov 13, 2026
8a082c2
test: unpin legacy envelope suites from the storage baseline (#6547)
sx4im Nov 13, 2026
1d2c8d2
fix: forward single-shot Responses server-tool calls instead of 400 (…
sx4im Nov 13, 2026
de2212c
fix(loop): drop a tool-typed tag-echo span whole instead of keeping i…
gongfpp Nov 13, 2026
32aa9d7
fix(loop): a self-closing tool-typed echo is a unit, not an opening (…
Nov 14, 2026
a4f1e78
Merge master into fix-6548-pi-fetch-xai-400
sx4im Nov 14, 2026
6190fb3
fixup: restore import brace spacing in merged handle.ts
sx4im Nov 14, 2026
cc2d09e
fix(openai): route tool-less audio (TTS) requests through the side pa…
sx4im Nov 14, 2026
a92c1c0
Merge remote-tracking branch 'origin/master' into pr-6638
Nov 14, 2026
6321ba0
fix(tests): WC-025 validator mirrors the isAudioOutputCall no-tools v…
Nov 14, 2026
c070df9
Merge master into fix-6547-legacy-envelope-suites-red
sx4im Nov 14, 2026
baee51f
fix: retain large seed envelopes on the incremental lane
mariopasquali Nov 8, 2026
ec576aa
fix(hermes-plugin): resolve the bili dist without a bili.json sidecar
Overview3833 Nov 14, 2026
d1b02b3
fix(dsh): restore tools after registration owner teardown
Delthin Nov 14, 2026
730877c
fix(web): bind color-scheme on the OS-driven dark palette
OMSociety Nov 13, 2026
4e12515
fix: point the color-scheme notes at the right issue (#6588)
OMSociety Nov 14, 2026
dd1bd81
fix: pin docs Markdown to LF in .gitattributes (#6692)
OMSociety Nov 14, 2026
42fd2ff
fix(stream): keep requested ref numbers in stale-ref compress receipts
sx4im Nov 14, 2026
2561732
style(tests): move cordis import to top of file
Nov 14, 2026
983b272
fix: cite the correct issue (#6587, not #6588) for the color-scheme fix
Nov 14, 2026
dd6d34a
docs: correct the default message timestamp display note
Afloat16 Nov 14, 2026
2c4ea46
fix(pi): charge policy-gate refusals to the compress failure ledger
sx4im Nov 14, 2026
b894002
fix: preserve Unicode boundaries in recorded user agents
Afloat16 Nov 14, 2026
412bb63
refactor: drop dead repeat-guard capture in the #6728 policy-gate bra…
Nov 14, 2026
3664e6e
test: fix the fold report comparison clock
Afloat16 Nov 14, 2026
0eaff45
Merge Afloat16/2026-11-14_linear-coverage-timestamps (PR #6716) into …
ranxianglei Nov 14, 2026
9a1c679
Merge Afloat16/2026-11-14_linear-fold-registration (PR #6747) into ba…
ranxianglei Nov 14, 2026
95227c1
Merge Afloat16/2026-11-14_diagnostics-unicode-bounds (PR #6750) into …
ranxianglei Nov 14, 2026
a2cf2f0
Merge sx4im/fix-6728-policy-gate-ledger (PR #6753) into batch10-wave10
ranxianglei Nov 14, 2026
8a70e1e
Merge sx4im/fix-6712-compress-receipt-stale-refs (PR #6714) into batc…
ranxianglei Nov 14, 2026
e488b7e
Merge OMSociety/2026-11-14_docs-eol (PR #6693) into batch10-wave10
ranxianglei Nov 14, 2026
f24173e
Merge mariopasquali/2026-11-14_incremental-large-seed (PR #6681) into…
ranxianglei Nov 14, 2026
6fe3284
Merge Overview3833/2026-11-14_hermes-native-dist-fallback (PR #6672) …
ranxianglei Nov 14, 2026
78d128d
Merge sx4im/fix-6636-openai-wire-acp-injection (PR #6638) into batch1…
ranxianglei Nov 14, 2026
9f1c291
Merge gongfpp/fix/tool-typed-echo-drop (PR #6633) into batch10-wave10
ranxianglei Nov 14, 2026
27bf2e5
Merge OMSociety/2026-11-14_web-dark-native-controls (PR #6589) into b…
ranxianglei Nov 14, 2026
2f92132
Merge sx4im/fix-6548-pi-fetch-xai-400 (PR #6574) into batch10-wave10
ranxianglei Nov 14, 2026
fd60415
Merge sx4im/fix-6547-legacy-envelope-suites-red (PR #6561) into batch…
ranxianglei Nov 14, 2026
a827683
Merge sx4im/2026-11-13_phantom-read-forwarding (PR #6544) into batch1…
ranxianglei Nov 14, 2026
fcee1c0
Merge tinysunspot/2026-11-13_audit-drain-dropped-head (PR #6537) into…
ranxianglei Nov 14, 2026
7c17438
Merge tinysunspot/2026-11-13_google-lane-inert-frame-guard (PR #6535)…
ranxianglei Nov 14, 2026
89a671e
Merge MohammadErfan-Jabbari/2026-11-13_rejected-nudge-rearm (PR #6531…
ranxianglei Nov 14, 2026
0a73563
Merge zouzh22/2026-11-13_measured-overflow-retry (PR #6529) into batc…
ranxianglei Nov 14, 2026
73737b6
Merge MohammadErfan-Jabbari/2026-11-13_claude-mcp-config-prompt (PR #…
ranxianglei Nov 14, 2026
ad8600f
Merge Delthin/2026-11-14_dsh-tool-registration-lifetime (PR #6706) in…
ranxianglei Nov 14, 2026
ce0139b
test(hermes): escape backticks in the generated Python driver (#6672)
ranxianglei Nov 14, 2026
340efc2
chore(batch): drop four close_*.txt scratch files swept into the #657…
Nov 14, 2026
e64ad7e
test(hermes): make the no-sidecar / no-dist resolution assertions her…
Nov 14, 2026
938040f
fix(server): re-arm rejected nudges on the google/openai/responses la…
ranxianglei Nov 15, 2026
cdc0ce9
Merge remote-tracking branch 'origin/batch10-wave10' into batch10-wave10
ranxianglei Nov 15, 2026
4c8824e
fix(server): release the rejected-nudge hold on no-usage successes to…
ranxianglei Nov 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ tests/golden/web-hitrate/*.svg text eol=lf
# "every fixture artifact matches its recorded digest and size" failed every
# windows-latest leg (run 38982246862).
tests/fixtures/vertex-anthropic/* text eol=lf

# #6692: docs/ Markdown is prose rather than byte-exact, but Git-for-Windows'
# default autocrlf=true rewrote whole files to CRLF on commit (a +18-line docs
# PR landed as +1509/-1489). Pin LF so Windows-side edits stay line-accurate.
docs/**/*.md text eol=lf
3 changes: 3 additions & 0 deletions docs/technical-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ here instead of between the options.
## Rejected-request token measurements

Context-overflow recovery distinguishes the upstream context window from the rejected request's total, input-message count, and completion reservation. The parser accepts both the OpenAI/DeepSeek parenthesized split (`requested N tokens (M in the messages, C in the completion)`) and the SGLang/LiteLLM colon-separated split (`requested a total of N tokens: M tokens from the input messages and C tokens for the completion`). Explicit input counts feed the existing calibration ring; completion counts arm the existing output-headroom reservation. A window-only or incomplete error provides no invented token measurements. This parsing is shared by plugin and proxy modes and does not change the declared model window.

When a 400/413 reports a complete, consistent token split and the input fits, the relay can retry that payload once with the output budget capped at the measured remaining space. It checks the reported completion reservation against the actual output field and preserves an explicit thinking budget. The same recovery applies after a refold. Requests with an egress transform configured use the existing refold path because the transform can change the input between attempts.

## Fork recovery after a short source view

Fork adoption judges retained compression blocks against the child replay, rather than the source's last `active` flags. A short source request may temporarily deactivate a fold whose complete original span returns in the child. Fully present retained spans are copied as active blocks; explicitly expanded blocks, consumed tier children, and spans crossing the fork boundary are not independently activated. Tier children accompany an adopted ancestor as inactive records. Planning and adoption never mutate the source session.
Expand Down
3 changes: 3 additions & 0 deletions docs/technical-notes.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ README 三种使用方式背后的机制级说明。README 里每种方式只保
## 被拒请求的 token 计量

上下文溢出恢复分别处理上游窗口上限、被拒请求的总量、输入消息量和回复预留量。解析器同时识别 OpenAI/DeepSeek 的括号句式(`requested N tokens (M in the messages, C in the completion)`)及 SGLang/LiteLLM 的冒号句式(`requested a total of N tokens: M tokens from the input messages and C tokens for the completion`)。明确的输入计数进入现有校准环;回复计数触发现有的输出余量预留。只有窗口上限或拆分不完整的错误不会产生虚构计量。插件模式与代理模式共用该解析,不改写声明的模型窗口。

当 400/413 给出完整且一致的 token 计数,并且输入本身能放进窗口时,中继可以按实测剩余空间缩减回复额度,并用同一份输入重试一次。中继会核对报告的回复预留量与实际请求字段,并为显式思考预算保留空间。重新折叠后的请求也可以按同样规则恢复。配置了出站改写的请求继续走现有的重新折叠流程,因为改写可能让两次发送的输入不同。

## 来源短视图之后的 fork 恢复

fork 继承依据子会话重放内容判断保留的压缩块,不直接沿用来源上一次请求的 `active` 标记。来源的一次短请求可能暂时停用某个块,而子会话重放时包含它覆盖的完整原文。完整存在的保留块独立复制并激活;明确解压的块、被高层块消费的子块及跨越 fork 边界的块不会独立激活。被继承高层块的子块作为非活动记录随行。规划和继承均不修改来源会话。
Expand Down
40 changes: 32 additions & 8 deletions hermes-plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,44 @@ def sidecar_path() -> Path:
return Path(__file__).resolve().parent / "bili.json"


def bundled_dist() -> Optional[Path]:
"""A host-managed copy of the package: `hermes plugins install` runs npm in this
plugin's own directory when its package.json declares billion-context."""
dist = Path(__file__).resolve().parent / "node_modules" / "billion-context" / "dist" / "index.js"
return dist if dist.is_file() else None


def path_dist() -> Optional[Path]:
"""The reference lane (#1196): the global install's dist, reached through the `bili`
entry point on PATH — an executable symlink onto dist/index.js."""
exe = shutil.which("bili")
if not exe:
return None
real = Path(os.path.realpath(exe))
return real if real.is_file() and real.suffix == ".js" else None


def load_sidecar() -> Optional[Dict[str, str]]:
"""The installer's sidecar: which bili dist + node binary to spawn."""
"""Which bili dist + node binary to spawn. First hit wins, nothing is ever written:
1. bili.json, the sidecar `bili plugin install hermes` drops (reference lane);
2. this plugin's node_modules, when the host installed the package itself;
3. the global install's dist, via `bili` on PATH."""
try:
data = json.loads(sidecar_path().read_text(encoding="utf-8"))
except Exception:
return None
data = {}
if not isinstance(data, dict):
data = {}
node = data.get("nodePath") or shutil.which("node")
if not node or not isinstance(node, str):
return None
script = data.get("proxyScript")
node = data.get("nodePath") or shutil.which("node")
if not script or not isinstance(script, str) or not Path(script).is_file():
script = ""
found = Path(script) if script else (bundled_dist() or path_dist())
if found is None:
return None
if not node or not isinstance(node, str):
return None
return {"script": script, "node": node}
return {"script": str(found), "node": node}


# — gating --------------------------------------------------------------------
Expand Down Expand Up @@ -1871,8 +1894,9 @@ def register(ctx: Any) -> None:
return
sidecar = load_sidecar()
if not sidecar:
logger.warning("billion-context: no usable bili.json sidecar next to the hermes plugin "
"(run `bili plugin install hermes`) — staying inert")
logger.warning("billion-context: no bili dist found (no usable bili.json sidecar, no "
"node_modules/billion-context, no `bili` on PATH) — run `bili plugin "
"install hermes` — staying inert")
return
# 1) Everything cheap and blocking-free goes in FIRST. The host caps import+register() at
# its load deadline (10s) and ABANDONS the load on timeout — every registration made
Expand Down
9 changes: 9 additions & 0 deletions hermes-plugin/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ provides_tools:
- compress
- decompress
- acp_status
- acp_cache
- search_context
# withheld when imageRescale is off; the host warns on declared-but-unregistered, never fails
- acp_read_original_image
provides_hooks:
- pre_api_request
provides_middleware:
- llm_request
# alias for hosts that predate provides_hooks (plugins_cmd_catalog reads provides_hooks, then hooks)
hooks:
- pre_api_request
41 changes: 41 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"jimp": "1.6.1"
},
"devDependencies": {
"@deepseek-ai/cordis": "4.1.0",
"@earendil-works/pi-coding-agent": "0.83.0",
"@earendil-works/pi-tui": "0.83.0",
"@types/node": "^22.0.0",
Expand Down
Loading
Loading