fix(openai-history): stop refusals and empty messages from forcing page breaks - #178
Merged
Conversation
…ge breaks Three independent topics, squashed at request. Responses planner: `responseMessageText` gated imageability on an allow-list of part names (`input_text`/`output_text`/`text`). A `refusal` part is plain model-authored prose, but it failed that gate, so the whole message became non-imageable -- and a non-imageable message is a hard barrier that ends the collapse run. A single refusal cost a page break. Gate on the payload being a string instead of on the part's name. Likewise an empty or whitespace-only message was a barrier despite having nothing to render; skipping it changes no ordering, so it no longer splits a run. Items with non-text parts (images, unknown shapes) stay barriers. Adds `barrierTypes` to the transform event: the item types that ended a run, with counts, descending, capped at 8. Diagnostic only -- never affects routing -- so an incidental page-breaker can be told from an unavoidable one. Claude profile: BASE_HISTORY was tuned against GPT page geometry, where a page holds ~660 chars; a Claude page holds ~2750. Re-derived against the same first-byte latency signal (n=11k) and retuned four settings -- maxImages 32 -> 96, framing full -> compact, factSheetScope per-segment -> combined, responsesMode pairs -> mixed. 'mixed' matters because 'pairs' only groups index-contiguous tool rounds and Codex interleaves assistant messages between them, so every round was landing in its own image. Non-message items remain hard barriers, so protocol order and open call/output state are unchanged. restart.sh: replace the duplicated pgrep filter with a `list_serving_pids` function, because bash 3.2 (still macOS's /bin/bash) mis-parses a `case` pattern's closing paren inside `$(...)`. Also adds `--detach`, which starts the proxy under nohup and waits for it to actually bind the port, so non-interactive callers don't SIGHUP the proxy on exit. Tests: 5 new barrier-fill cases; 954 pass, tsc clean.
qbq-leo-martens
pushed a commit
to qbq-leo-martens/pxpipe
that referenced
this pull request
Aug 5, 2026
…-history page breaks (teamchong#178), warp host:port routes (teamchong#175), macOS restart fix
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.
Three independent topics, squashed at request.
Responses planner:
responseMessageTextgated imageability on an allow-listof part names (
input_text/output_text/text). Arefusalpart is plainmodel-authored prose, but it failed that gate, so the whole message became
non-imageable -- and a non-imageable message is a hard barrier that ends the
collapse run. A single refusal cost a page break. Gate on the payload being a
string instead of on the part's name.
Likewise an empty or whitespace-only message was a barrier despite having
nothing to render; skipping it changes no ordering, so it no longer splits a
run. Items with non-text parts (images, unknown shapes) stay barriers.
Adds
barrierTypesto the transform event: the item types that ended a run,with counts, descending, capped at 8. Diagnostic only -- never affects
routing -- so an incidental page-breaker can be told from an unavoidable one.
Claude profile: BASE_HISTORY was tuned against GPT page geometry, where a page
holds ~660 chars; a Claude page holds ~2750. Re-derived against the same
first-byte latency signal (n=11k) and retuned four settings -- maxImages
32 -> 96, framing full -> compact, factSheetScope per-segment -> combined,
responsesMode pairs -> mixed. 'mixed' matters because 'pairs' only groups
index-contiguous tool rounds and Codex interleaves assistant messages between
them, so every round was landing in its own image. Non-message items remain
hard barriers, so protocol order and open call/output state are unchanged.
restart.sh: replace the duplicated pgrep filter with a
list_serving_pidsfunction, because bash 3.2 (still macOS's /bin/bash) mis-parses a
casepattern's closing paren inside
$(...). Also adds--detach, which startsthe proxy under nohup and waits for it to actually bind the port, so
non-interactive callers don't SIGHUP the proxy on exit.
Tests: 5 new barrier-fill cases; 954 pass, tsc clean.