feat: session id is the client-provided conversation value verbatim; 400 without identity (#286) - #288
Merged
Merged
Conversation
…entity (#286) Strong-signal conversation identities (codex session-id/thread-id, claude x-claude-code-session-id, opencode x-opencode-session, Responses body session_id, prompt_cache_key) now derive the session id from hash(protocol|conversation) only. The 4-dim hash (protocol|upstream|credential|conversation) is retained for weak signals (content fingerprints), where the credential/upstream dimensions provide collision isolation. Rationale: the credential dimension is a rotating OAuth bearer for Codex/ChatGPT and the upstream dimension changes when users switch relays — either change orphaned all compression state mid-session (#280). The client's native session id is the only invariant bound to the conversation. One-time cost: existing persisted sessions are re-keyed once (old records orphaned), accepted per issue discussion.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-288Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr288.tgz
npm install -g packageThis comment is automatically updated on each push. |
Owner
Author
[bot] Review of PR #288 (branch Verified locally (reproduced CI checks on the branch)
Code-level verification
Non-blocking notes
CoordinationConfirmed: #249's Per repo rules I will not merge — please merge manually: #288 |
…400 without identity (#286)
…nt-provided ids (#286)
…ot first-wins session meta (#286)
- dsh: force PI_CACHE_RETENTION=long so pi-ai stamps prompt_cache_key (the dsh session uuid) on every request; the prompt_cache_retention side-effect field is stripped proxy-side before forwarding upstream. - hermes: write a bili-session-identity provider plugin into the ~/.hermes-bili overlay — it re-registers the bundled custom profile (plus custom:<name> for every proxied provider) with the real hermes session id as prompt_cache_key. Skipped when ~/.hermes already has a plugins/ dir (never write through the overlay symlink). - fix: prepareHermesHome now strips YAML quotes before matching api values — quoted endpoints previously failed to rewrite silently. - prompt_cache_retention stripped on the openai and responses paths (OpenAI-host-only directive; third-party upstreams may reject it).
This was referenced Aug 27, 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.
#286:session ID = client-provided conversation 值原文(无 hash、无其他维度)
设计(owner 确认)
session-id/thread-id、claudex-claude-code-session-id、opencodex-opencode-session、Responses bodysession_id/metadata.session_id、prompt_cache_key等。sessions/<proto>/<host>_<sha>.json由此派生,更新会孤儿化旧文件);persist.ts 无需改动(文件名已是 id 的 sha256,id 从文件体读取)。变更
src/session-id.ts:删除deriveSessionId/extractKey;保留clientConversationHeader/affinityToken/preferPromptCacheKeyIdentity。src/server.ts:sessionId = conversation(原文)。compressProtocol配置原先按session.meta.upstreamOrigin(first-wins)解析——切换中转后新中转的配置会被静默忽略;现按请求实际 upstream 解析。safeSessionId)——id 现在是客户端原始值。e2e-session-identity.test.ts重写(10 例:bearer 轮换 / 中转切换 / 跨协议续接 / 匿名 400 ×3 / 隔离);7 处匿名测试调用点补强信号;2 个 headless-binding 测试首请求带与 register 不同的强信号(保持走 pending 路径)。代价
验证