Skip to content

fix(openai-history): stop refusals and empty messages from forcing page breaks - #178

Merged
teamchong merged 1 commit into
mainfrom
fix/responses-barrier-fill
Aug 4, 2026
Merged

fix(openai-history): stop refusals and empty messages from forcing page breaks#178
teamchong merged 1 commit into
mainfrom
fix/responses-barrier-fill

Conversation

@teamchong

Copy link
Copy Markdown
Owner

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.

…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.
@teamchong
teamchong merged commit 508fc9d into main Aug 4, 2026
9 of 11 checks passed
@teamchong
teamchong deleted the fix/responses-barrier-fill branch August 4, 2026 12:11
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant