Skip to content

fix(browser): read transcript turns keyed by turn ids - #110

Merged
youdie006 merged 1 commit into
container/redesign-patchesfrom
fix/container-uuid-turn-keys
Nov 17, 2026
Merged

youdie006 merged 1 commit into
container/redesign-patchesfrom
fix/container-uuid-turn-keys

Conversation

@youdie006

Copy link
Copy Markdown
Owner

Problem

Every consult sent through the browser container failed with request_mismatch ("The latest visible user turn could not be verified against this prodex request"), although the prompt had posted and been answered. Four consults in a row from a Claude Code session on 2026-11-17 were blocked, the last a one-word probe whose answer ("OK") was sitting in the tab. The container's last successful consult was on 2026-11-04.

Cause (measured read-only on the live WSL container tab)

  • The page has no [data-message-author-role] nodes. Each message unit carries data-content-search-unit-key="<turn uuid>:<position>:<role>" (user :0:user, assistant :2:assistant); the prefix is the turn's id (equal to data-content-search-turn-key), not the conversation id.
  • The container branch's transcript reader (from 1ad5a0e) accepted only fallback-turn-<n>:<position>:<role>, both in CHATGPT_FALLBACK_TRANSCRIPT_MESSAGE_SELECTOR and in the page script's fallbackMessageKeyPattern. The container's own answerExpression(), evaluated on the tab with its one click disabled, returned userMessageCount: 0, assistantMessageCount: 0.
  • So after submit the URL change counted as acceptance, requestMatches failed on an empty user turn, and the send threw request_mismatch (the hasChatGptPromptAcceptance branch, which records no thread).
  • main's reader keys on data-chatgpt-search-unit-key ending in :user/:assistant and reads this page (1 user, 1 assistant, marker found), so npm installs are not affected.

Fix

  • The selector matches unit keys ending in :user or :assistant; the page script accepts a numbered turn or a UUID turn, numbers UUID turns in page order, and keeps reading a page that mixes both kinds of key as no transcript.
  • The fake DOM's querySelectorAll in tests/chatgpt-browser.test.ts mirrors the new selector.

Verification

  • Three new tests in tests/chatgpt-browser.test.ts failed before the fix (0 messages; marker not acknowledged; mixed keys read one message) and pass after; reverting only the src change turns them red again.
  • npx tsc --noEmit clean; full suite 2271 passed, 3 skipped.
  • Live, read-only (no click, no navigation, no send): the fixed answerExpression() and chatGptPromptPostedExpression() on the WSL container tab see 1 user and 1 assistant message, the request marker and the 2-character answer, and report the request as posted; the deployed code sees 0 and 0.
  • Not done: the container images are not rebuilt or swapped (needs the owner's go-ahead); M3's container runs the same code and is presumably affected but was not inspected.

Every consult through the browser container failed with
request_mismatch although the prompt posted and was answered (four in
a row on 2026-11-17, the last a one-word probe). ChatGPT now keys each
message unit as `<turn uuid>:<position>:<role>` where it used to write
`fallback-turn-<n>:<position>:<role>`, and the container's transcript
reader accepted only the numbered form. It counted no messages, took
the move to the new conversation as acceptance, and found no user turn
carrying the request marker.

The unit selector now matches keys ending in :user or :assistant, the
page script accepts a numbered or UUID turn, numbers UUID turns in page
order, and still reads a page mixing both kinds of key as no
transcript. The fake DOM in the tests mirrors the new selector.

Verified: three new tests failed before the fix (0 messages; marker not
acknowledged; mixed keys read one message) and pass after; reverting
the src change turns them red again; tsc clean; full suite 2271 passed,
3 skipped. The fixed answerExpression and chatGptPromptPostedExpression,
evaluated read-only on the live WSL container tab (click disabled),
see 1 user and 1 assistant message, the request marker and the answer;
the deployed code sees 0 and 0. main's reader (data-chatgpt-search-
unit-key) already reads this page.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T00:55:53.286503Z 608bcde PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

What this touches

  • browser adapter
  • tests

3 file(s), 87 line(s) changed. Tests changed.

This is an automated first pass, not a review. CI is the gate; a person decides.

@youdie006
youdie006 merged commit 58650ce into container/redesign-patches Nov 17, 2026
7 checks passed
youdie006 added a commit that referenced this pull request Nov 17, 2026
0.40.52 (51da80d, PRs #100 and #105-#109) published on its first publish
run and is installed on WSL, M3 and the Mac mini; the MacBook M4 did not
answer ssh and still runs 0.40.51. The browser containers on WSL and M3
were rebuilt twice: from 58650ce (container PR #110), which fixes the
request_mismatch every container consult hit once ChatGPT keyed
transcript units by turn id, and then from 9969a64 (container PR #111),
which ports this release's fixes. Each swap was gated on the send lock,
and a smoke consult answered with its request verified on both hosts
after each.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
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