Skip to content

Find a Codex answer that ends with a file link on screen (chat said "Conversation unavailable") - #59

Merged
devswha merged 1 commit into
devswha:mainfrom
Yoonwoo-Ha:fix/codex-match-link-answers
Sep 26, 2026
Merged

devswha merged 1 commit into
devswha:mainfrom
Yoonwoo-Ha:fix/codex-match-link-answers

Conversation

@Yoonwoo-Ha

Copy link
Copy Markdown
Contributor

Problem

A Codex pane's chat said "Conversation unavailable — show terminal output" on every poll while its terminal was attached, although the rollout was fine. With the terminal detached, the same pane's chat worked.

Live case: the Codex final answer ended with [실험 결과와 근거](/home/rise/Downloads/EdgePose/output/test/.../REPORT.md).

Cause

  • Codex renders a markdown link as its label and the target relative to the cwd: 실험 결과와 근거 (output/test/.../REPORT.md). The rollout keeps the absolute target.
  • matchCodexTranscript anchors on the last 160 letters and digits of each answer. For this answer, that anchor included homeriseDownloadsEdgePose…, which is never on screen.
  • When the terminal is attached, herdr's 400-line read of an alt-screen pane returns only the visible screen, since the alt-screen harvest is refused while attached. The last answer is then often the only one on screen, so no candidate matched and the chat fell back to scrollback.

Fix

The anchor is now the end of the last piece of the answer, between link targets, that is long enough (](…) cuts the text). The label stays in the piece before the target, so the anchor is contiguous on screen. An answer without links gets the same anchor as before.

Tests

  • server/codex.test.ts, new unit test: an answer ending with a link and an answer with a link in the middle both match their rendered form. The rendered link alone does not match. It fails on main.
  • bun test 367 pass, tsc --noEmit clean.
  • Live, in headless Chrome with the terminal attached, on the real pane:
    • before the fix: every poll returned {"source":"scrollback"}
    • after: the chat shows the conversation, 12 turns loaded

🤖 Generated with Claude Code

Codex renders a markdown link as its label and the target relative
to the cwd ("label (output/x.md)" for `[label](/repo/output/x.md)`),
while the rollout keeps the absolute target. The binding anchor, the
last 160 letters and digits of an answer, then ran into a path the
screen never shows. With the terminal attached, herdr's read is only
the visible screen, where the last answer is often the only one: the
chat said "Conversation unavailable" on every poll (live: a Codex
pane whose final answer ended with a REPORT.md link).

The anchor is now the end of the last piece of the answer between
link targets that is long enough. Without links nothing changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Yoonwoo-Ha
Yoonwoo-Ha force-pushed the fix/codex-match-link-answers branch from 05733be to 13f3ce8 Compare September 26, 2026 11:31
@devswha
devswha merged commit 7a70215 into devswha:main Sep 26, 2026
razakiau added a commit to razakiau/herdr-web-ui that referenced this pull request Oct 26, 2026
Mermaid ends a sequence statement at ";". An agent's Ask User card had
"COMMIT T1 (synced; the app gets "OK" now)" in a message, so the whole
diagram failed to parse and showed as a code block. Only some cards broke:
the ones with a semicolon in a message or note.

When a sequenceDiagram fails to parse, it is drawn once more with each ";"
after a statement's ":" written as mermaid's devswha#59; entity. A diagram that
already parses (including statements split with ";" on one line) is drawn
as before. Rejected: always escaping, which would break those one-line splits.

Verified: mermaid.test.ts RED on the new case, GREEN after (6 pass); the
owner's real diagram from the sparklin-devops chat now renders with the
text intact; tsc clean.
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.

2 participants