fix: re-attach the original openai wire system on rebuild (kernel system hoist) - #129
Open
ranxianglei wants to merge 2 commits into
Open
fix: re-attach the original openai wire system on rebuild (kernel system hoist)#129ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
…tem hoist) The kernel (0.0.37) hoists the leading system/developer prefix out of the openai fold space: system content is host runtime state (45k live vs ~7k reconstruction across restarts), so keeping it inside the id space made every span fingerprint unstable AND let a compression covering the system piece delete the model's system prompt from every rebuilt payload (glm-5.3 wire: systemLen 45151 -> 0 after the first compression). - payloadToCore now carries systemText from the kernel hoist - restoreOpenaiSystemPrefix re-attaches the ORIGINAL contiguous leading system/developer messages verbatim on rebuild (roles/count/name fields preserved), mirroring the anthropic top-level system path - restart regression: live wire system with runtime injections the restart cannot reproduce - block survives pre-LLM and the original system rides every rebuilt payload
ranxianglei
force-pushed
the
2026-08-22_openai-system-hoist
branch
from
August 22, 2026 11:57
474aa4c to
9c131f5
Compare
This was referenced Aug 22, 2026
Open
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
Restart on provider-mode openai wire (glm-5.3 etc.): pre-restart panel shows blocks; post-restart panel shows
Blocks: none, Sent-to-LLM balloons 146k → 546k, all ranges reappear uncompressed. Blocks only re-materialize at the first provider request. Additionally: after any compression covering the first span, rebuilt payloads lose the system prompt entirely (live wiresystemLen45151 → 0).Root cause
The openai wire's leading system message sat INSIDE the fold id space (it took m00001). System content is host runtime state — live 45k chars vs ~7.4k reconstruction across restarts — so:
anthropic (top-level
system) and responses (instructions) never had this — openai was the odd codec folding system into the id space.Fix (with acp-kernel 0.0.37)
Kernel PR ranxianglei/acp-kernel#120 hoists the contiguous leading system/developer prefix out of the openai fold space;
openaiToCorenow returns{ msgs, systemText }. This PR:payloadToCorecarriessystemTextfrom the kernel hoistrestoreOpenaiSystemPrefix(originalMessages, rebuilt): re-attaches the ORIGINAL contiguous leading system/developer messages from the wire verbatim (roles / count / name fields byte-for-byte), mirroring the anthropic top-level system path — never the reconstructionsrc/index.tscomposes fidelity-restore + system-restoreTests