fix(server): draft retry after failed bootstrap, and a Codex O(n²) buffering fix - #164
Merged
Conversation
…p (#8226) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit a40aef4ccbc10b7bcd7bc817151db8d5a9b1c257)
(cherry picked from commit 702a6ade3c69bf1c9ce06ad0451dbd8e0ecc7be9)
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Two adopted from the
f94a0d646..bcb855a63upstream review.#8226— a draft can retry its first send after a failed bootstrap. Conflicted: the resolution takes upstream'sthreadDeletionReactorbut drops the adjacentconst analytics = yield* AnalyticsService.AnalyticsService;, which Pylon deliberately removed when#7774landed as plumbing only. Same inserver.test.ts. Verified noAnalyticsreference survives andthreadDeletionReactoris genuinely used.#8605— the Codex app-server stdin reader didcurrent + chunkper chunk, re-concatenating and re-splitting the whole buffer. Now keeps fragments in an array and joins at line boundaries. Clean cherry-pick.Dropped from this group:
#8610#8610("stop querying Claude context usage after turns") was in the approved set, and I dropped it after review. It deletesnormalizeClaudeContextUsageApiSnapshot, which is the only producer ofcompactsAutomatically. The chain:origin/pylonhadcompactsAutomatically: value.isAutoCompactEnabled; after the pick nothing supplies it;contextWindow.ts:92defaults it tofalse;ContextWindowMeter.tsx:266gates the "Compacts automatically at N tokens" indicator on it. Claude threads lose it while Codex keeps it.The Claude SDK exposes
isAutoCompactEnabledonly on thegetContextUsageresponse, so the round-trip and the indicator are mutually exclusive. Upstream shipped this unnoticed — no test asserts the field, and its own new test suppliesisAutoCompactEnabled: trueon a mock it then asserts is never called.Known upstream design concerns, not addressed here
#8226fences everythread.createonthreadDeletionReactor.drainThrough, which ends in a sharedworker.drain— so creating a thread waits on all in-flight deletions, not the one whose id is reused.drainThroughis also typedEffect<void>with no timeout. Both are upstream's shape and latent today; flagging rather than patching upstream's design mid-adoption.Verification
Adversarial review found the
#8610regression and both design concerns.t3typecheck clean. 127 focused tests pass acrossThreadDeletionReactor,ProjectionPipeline,commandInvariants,protocol, andClaudeAdapter. The reviewer fuzzed the new line splitter over 20,000 random chunk sequences against the old implementation — identical output including\r\nstraddling chunk boundaries.Model: Claude Opus 5. Harness: Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.