fix: re-inject the client's openai system around the kernel hoist (0.0.37) - #193
Closed
ranxianglei wants to merge 2 commits into
Closed
fix: re-inject the client's openai system around the kernel hoist (0.0.37)#193ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
…0.37) The kernel hoists the contiguous leading system/developer prefix out of the openai fold space (system content is host runtime state - it must not feed ids/fingerprints, and a compression covering it used to delete the model's system prompt from every rebuilt payload). The proxy must now carry it around the fold: - prepareOpenai captures systemText from openaiToCore and re-injects it (client system first, compress prompt after) into every rebuilt payload - Prepared.openapiSystemText flows into pickAdapter so compress-loop rounds re-inject it too, mirroring the anthropic adapter's anthropicSystem path - createOpenaiAdapter gains a clientSystem param
This was referenced Aug 22, 2026
Owner
Author
|
防止模型擅自合并,先关闭 |
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.
Symptom
The kernel (PR ranxianglei/acp-kernel#120, released 0.0.37) hoists the contiguous leading system/developer prefix OUT of the openai fold space: system content is host runtime state and must not feed ids/fingerprints, and a compression covering it used to delete the model's system prompt from every rebuilt payload.
Consequence for the proxy: after upgrading the kernel alone,
openaiToCore's msgs no longer carry the system at all — without this PR every forwarded payload and every compress-loop round would silently drop the client's system prompt.Fix
prepareOpenaicapturessystemTextfromopenaiToCoreand re-injects it into every rebuilt payload (client system first, compress prompt after — preserves the prefix-cache-anchor ordering)Prepared.openaiSystemTextflows intopickAdapter→createOpenaiAdapter(requestBody, clientSystem)so compress-loop rounds re-inject it too, mirroring the anthropic adapter'santhropicSystempathbuildRequestinjects[clientSystem, compressPrompt](empty parts filtered)Note the proxy never had the restart-fingerprint failure (MITM sees the real wire every round) but DID inherit the compression-eats-system bug — and would lose system entirely on 0.0.37 without this change.
Tests