Skip to content

fix(native-chat): list every question of a terminal-chat ask, with known answers - #23455

Open
brennanb2025 wants to merge 7 commits into
mainfrom
brennanb2025/native-chat-multi-question-terminal
Open

brennanb2025 wants to merge 7 commits into
mainfrom
brennanb2025/native-chat-multi-question-terminal

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​744 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​712
Prod 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​448 $\color{#cf222e}{\Huge{\mathbf{−}}}$​44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​404

ELI5

When an agent in a terminal-based chat asks you several questions at once, the chat used to leave behind a line that only said "Asked: 3 questions". You could not see what the questions were or what you answered. Now that line opens to list every question, and under each one the answer you gave, but only when the agent saved that answer in a form Orca recognizes. When Orca is not sure, it shows the questions alone, never a guessed answer.

What Changed

Before: in chats that Orca draws by reading the agent's transcript file (Claude, Codex, Grok and others), a grouped ask showed "Asked: N questions" with nothing to open. A single question could be opened only when it was too long for its line, and no row ever showed an answer.
After: the "Asked" row opens whenever it hides something: a question list, a clipped question, or a known answer. Each question is shown in full, with its answer on the line below in muted text. A single short question that has a known answer can now be opened to see that answer.
The rule for every agent: an answer is shown only when the agent's result matches a recognized shape; otherwise the questions are shown alone. Each agent's reader lists exactly the keys, ids and value types it accepts, and anything outside that list, including a shape a future release adds, means no answers rather than a best guess. Both readers live in one shared file, src/shared/native-chat-ask-answers.ts.
Claude: Claude's transcript stores the answers as data next to the text it hands the model, keyed by each question's exact text. The Claude transcript decoder (main process) now copies those answers onto the tool-result block as a new optional askAnswers field (question text plus the parts of the reply), the same way it already copies edit hunks as editPatch. The decoder calls the shared Claude reader, which accepts a result only when its keys are among questions, answers, annotations, response, followUp and afkTimeoutMs, each note holds only preview or notes, every answer sits under the exact text of a question that was asked, and every answer is text or a list of text. A text answer is kept whole, never split on commas, because typed replies can contain commas. A note the reader typed beside their choice follows it, and when they typed only a note, the note is shown instead of the placeholder Claude records in that case. A list of labels, and a label with its note, are joined with " · ", the same separator constant the answered-prompt receipt now uses.
Claude records two results whose answers the agent never received as answers: a prompt that timed out while the reader was away (their picks were never submitted), and a free-text reply sent in place of the answers. Those show the questions without answers. The prose text is never parsed, because its wording changes between releases and it does not escape quotes.
Codex: Codex already stores its answers as JSON in the tool output, keyed by each question's id, and Orca already keeps that output on the block. Shared code now reads it and matches each answer to its question by id. The Codex reader runs only for Codex's question tool (request_user_input), chosen by the call's tool name, so a result from another agent is never read as Codex's. It accepts the output only when it holds nothing but answers, every id is one the call asked, and each entry holds only a list of text. So Codex needed no decoder change and no second copy of the data. The prefix Codex adds to typed notes is removed. "None of the above" is shown as chosen, followed by the note typed in its place. A question marked secret never shows its answer.
Grok, Pi, refusals, aborts, and anything that is not structured data show the questions without answers.
The row now uses one model for every question: its text, an optional id, and an optional answer. List items are keyed by the id when the agent gives one, otherwise by the text.
The answered-prompt receipt used by structured chats behaves exactly as before. It still lists answers below the row itself, so it passes questions without answers.

Why

The row may be the only place the questions are still visible once the ask is answered, so it should show all of them.
Answers are shown only where the agent recorded them as data in a shape Orca recognizes. Guessing them from prose, or reading a shape Orca has not seen, could show the wrong answer, which is worse than showing none. Accepting only known shapes makes that the default: a change in a future agent release shows the questions alone until Orca learns the new shape.
Where this differs from structured chats: a structured chat shows the answer Orca itself recorded when you answered in Orca. A terminal chat has no such record, because you answer inside the agent's own screen, so Orca reads the answer from the agent's own result record instead. That is why the terminal row trusts only shapes it recognizes.
Claude's answers are matched by question text because that is the only key Claude records. Codex's are matched by id because Codex records ids.
The Claude answers are normalized once, in the decoder, into what they mean (which question, what reply). The decoder does not pass a raw copy of the transcript record along, so readers never depend on the transcript's format.

Compatibility:
Remote hosts: askAnswers is a new optional field on an existing block. A client paired with an older host gets no field, and its Claude rows show questions only. Codex answers still appear, because they come from the output the host already sends. An older client ignores the field.
Mobile: mobile draws its own tool rows and does not use this row, so it looks the same. The phone payload drops the new field, because the phone never reads it and it would otherwise skip the size cap that trims the tool output. Older and newer phones see the same payload as before.
Worker transcripts (what an orchestrating agent reads back from a worker): the new field is dropped there too. Its answers already appear in the tool output, which that payload trims and scrubs of dispatch tokens, while the field would have skipped both.
Session history: when a terminal session's history is imported into a structured session, a tool result that is its message's only block loses its extra fields, as editPatch already does; Claude always writes an answered ask that way. So imported Claude asks show questions only there. The source transcript is unchanged.

Not in this PR (already true on the base branch): a Codex refusal or abort, and a Grok failure, show as an "Asked" row, because those results carry no error flag.

Linked Issue

None. Follow-up to #22941 and #23451 (merged); now based on main.

Visual Proof

Checked live in a background dev build of this branch (head 2fbccd01a7) on a second Mac, with an isolated profile and real terminal-backed Claude and Grok chats. Before this change these rows read "Asked: 2 questions" with no way to open them, and a short answered question showed no answer anywhere.

Claude, two questions, one answered with an option and one with typed text; the list shows each answer, typed text verbatim and selectable:
claude collapsed claude open selection

A short single question becomes a toggle once it has an answer:
single answered

Grok records no structured answer, so its list shows the questions only:
grok

Keyboard focus, and still open with answers after scrolling away and back:
keyboard back

A single long question still unfolds:
long open

Codex could not be checked live: on the test machine the Codex CLI never produced a question (its account was near its usage limit). The Codex answer paths are covered by the tests below.

Testing

Real-derived fixtures: the Claude and Codex fixtures copy the exact structure and key sets of results recorded on a developer machine, with every question, option, answer, id and path replaced by synthetic text. Claude: an answered pair where a multi-select answer is a list, a typed answer in place of an option, an answer whose option had a preview, and both recorded forms of a declined prompt. Codex: an answered one-question call, and its recorded refusal and abort outputs.
Synthetic fixtures: no recorded result showed a note, a note with no option chosen, a follow-up request, a typed response in place of answers, or an idle timeout. Those are written to Claude's published result type, plus the optional followUp flag the Claude command-line tool records.
Fail-safe tests: for Claude, an unknown top-level key, an unknown note key, an answer under a question that was not asked, and an answer that is a number each yield no answers. For Codex, an extra key (beside answers, or inside an entry), an id the call did not ask, and a non-text item each yield no answers. Row tests check that another agent's Codex-shaped output is not read as Codex's, and that a Codex call never reads the Claude field.
Real-record check: every question result in the local session history of a developer machine was run through the two readers. All 270 answered Claude results (Claude Code 2.1) and all 4 answered Codex results yield their answers; the 65 declined Claude results, the 352 Codex refusals and aborts, and every other tool's result in those Claude sessions yield none. The Claude key allowlist matches the full result type in the current Claude command-line tool, and the Codex one matches Codex's own answer type.
Other tests: the Claude reader's notes, "(notes only)", idle timeout, typed response and follow-up rules; Codex notes, "None of the above" and unanswered questions; matching answers to questions for both agents; secret questions; prose-only agents; the phone and worker-transcript payloads dropping the field; and renderer tests for answered, unanswered and older-host rows. The receipt tests from #23451 pass unchanged.
Each new test was checked by removing the code it covers (committed first, then removed and restored): it fails without that code.
pnpm tc, pnpm run check:code-quality:changed, pnpm run check:react-doctor:changed, and full oxlint on the touched files pass. The native-chat renderer, shared, main, RPC and worker-transcript tests pass (378 files); two timing tests outside this change failed once under heavy machine load and pass on rerun.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: a Codex question marked secret never shows its answer.
Cross-platform: no platform-specific code.
Remote SSH: see Compatibility under Why.
Mobile: no visual change and no payload change, see Compatibility under Why.
Backward compatibility: the new field is optional, and readers treat it as optional.
Performance: the row's question list is memoized with its tool run, and the Codex output is parsed only for answered question calls.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

A cancelled or pending structured ask with several questions showed only
"Asked: 2 questions", and its questions appeared nowhere in the transcript.
The row's subject now carries the question texts instead of a count, and
the row unfolds them as a list below its toggle unless the record already
lists them with their answers.
…stion

A pending Codex group is keyed by its first question, which becomes its own row once answered. Opening the list left that row expanded, and folding it could drop the toggle under the pointer. The list and a lone question now remember their open state separately.
…own answers

The "Asked" row in terminal-based chats named only "N questions" for a
grouped ask, and never showed what the reader answered. It now opens to
list every question, and each answer wherever the agent recorded it as
data: Claude's AskUserQuestion result keeps its answers beside the prose,
keyed by question text, and Codex's request_user_input output is JSON keyed
by question id. Prose-only results (Grok, Pi, refusals, aborts) and secret
questions show the questions alone.
…script wires

Both payload bounds rebuild a tool result by replacing only its output, so the
new answers field rode through unclipped, and in worker transcripts unredacted.
Neither reader draws answers, and the output already carries them bounded.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one verification ask on the secret-answer guard's reachability.

Reviewed changes

  • Shared row model — NativeChatAskRowSubject questions become { id?, text, answer? }, nativeChatAskRunBlocks returns paired { call, result } asks, and askCallQuestions resolves each question's id/secrecy plus a recorded answer (Claude by exact question text, Codex by id).
  • Codex answer reader — new src/shared/native-chat-ask-answers.ts parses {"answers":{"<id>":{"answers":[...]}}}, strips the user_note: marker, and decodes the call payload.
  • Claude decoder — claudeAskAnswers copies toolUseResult.{questions,answers} onto the tool result as askAnswers; withEditPatch generalized to withResultData.
  • Renderer — the awaiting row shows each question's answer beneath it and toggles whenever it hides a list, a clipped question, or a known answer; NativeChatToolRun no longer forces listsQuestions={false}, so grouped transcript asks now expand.

I verified both external contracts against upstream. Claude's toolUseResult carrying a questions array plus a text-keyed answers map (string or string[]) is confirmed by the official SDK docs and third-party parsers, so the decoder guard is sound. Codex's result/id/isSecret/user_note: shapes are real too — but see the inline note: isSecret lives on the protocol type, not in the model-facing tool schema Orca decodes.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/shared/native-chat-ask-row.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in the incremental changes; nothing actionable in the delta.

Reviewed changes

Incremental delta since 506d013 (the prior review) — commit 725f182, which keeps the new answers off the constrained wires:

  • Mobile wire — sanitizeNativeChatRpcBlock now strips askAnswers from mobile tool-result blocks, so the new field can't bypass the 4000-char mobile output cap. This is the single mobile choke point (native-chat.ts:31 via sanitizeMessage, reached by readSession and every subscribe frame), and runtime/unknown clients keep the field.
  • Worker transcript — boundWorkerTranscriptMessages/Tail drop askAnswers before clipping and the dcap_ redaction, so recorded answers can't skip either; the answers remain in the tool output the agent reads. Both functions route through boundBlock, so the strip covers the head and tail paths.
  • Tests — exact-equality assertions pin the mobile strip, the keep-on-runtime behavior, and the worker strip.

Not approving only because the earlier secret-guard question from the prior review remains open; the delta itself is sound.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…it received

Claude records a note the reader typed beside the chosen option in
`annotations`, and writes the stand-in "(notes only)" as the answer when no
option was chosen. The row showed that stand-in and dropped every note. An
idle timeout's unsubmitted picks, and answers replaced by a typed response,
were shown as answers the agent never received.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in the incremental changes. The delta's field assumptions are now verified against the shipped CLI, and nothing in it is actionable.

Reviewed changes

Incremental delta since 725f182 — commit d595c27, which teaches the Claude decoder to read a typed note and to keep answers only where the agent actually received them:

  • Typed notes — claudeAskAnswers now appends annotations[question].notes after the chosen labels, and drops Claude's (notes only) stand-in when the reader picked no option.
  • Answers the agent never received — the decoder records no answers when afkTimeoutMs is set (AFK auto-continue) or when a free-text response is present without followUp.
  • Question order — entries are built by iterating result.questions per question instead of Object.entries(answers), so order follows the prompt and stray answer keys are ignored.
  • Tests — synthetic records cover note-beside-a-choice, note-only, AFK, free-text, and follow-up cases; each fails if its guard is removed.

I also verified the fields this delta leans on, since the earlier reviews only confirmed questions/answers. The official @anthropic-ai/[email protected] sdk-tools.d.ts AskUserQuestionOutput declares response?, annotations? ({ preview?, notes? }, keyed by question text), and afkTimeoutMs?. The shipped linux-x64 bundle additionally confirms followUp (schema text: "Set when the user asked for another round of questions instead of (or after partially) answering."), the literal "(notes only)", and groups ["answers","annotations","response","followUp"] together. So the guards are real rather than dead code, they match the semantics claimed in the PR body, and they fail safe (drop answers) if a future release renames a field.

Not approving only because the earlier Codex isSecret reachability question from the first review remains open and is untouched by this commit.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…rca recognizes

Claude and Codex answers were read by rejecting the shapes known to be
wrong, so a result of any new shape could still show an answer. Each
reader now accepts only the keys, ids and value types its agent is known
to write, and anything else shows the questions alone.

- Claude: the result's keys, each note's keys, every answer's question
  and every answer's type must be recognized.
- Codex: every answer's id must be one the call asked, and each entry
  must hold only a list of text.
- The Codex reader is chosen by the call's tool name, not by the Claude
  field being absent.
- The Claude rules move next to the Codex rules in shared code; the
  answer separator is shared with the resolved-prompt receipt.
- Fixtures copy the structure of recorded Claude and Codex results with
  synthetic text.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in the incremental strictness hardening. The earlier Codex isSecret reachability thread remains open and unchanged, so this is not an approval.

Reviewed changes

Incremental delta since d595c27 — commit 2fbccd0, which makes each answer reader accept only the shapes its agent is known to write:

  • Strict shape validation — claudeAskAnswers and codexAskAnswers now reject any result whose keys, question ids, or answer value types fall outside the agent's known set, so an unrecognized shape shows the questions alone instead of a guessed answer.
  • Codex reader gated by tool name — codexAskAnswers is selected by call.name === 'request_user_input' rather than by the Claude field being absent, and every answer id must be one the call asked.
  • Shared Claude reader — claudeAskAnswers moved beside the Codex rules in src/shared/native-chat-ask-answers.ts, taking toolUseResult directly; the decoder calls it with record.toolUseResult.
  • Shared separator — NATIVE_CHAT_ANSWER_PART_SEPARATOR replaces the duplicated ' · ' literal in the ask row and the resolved-prompt receipt.
  • Fixtures — real-derived Claude and Codex fixtures replace inline synthetic records, and the reader, row, and decoder tests read from them.

The stricter readers fail safe in the direction the PR intends (no answers rather than a wrong one), and each new guard is pinned by an exact-equality test. I re-ran the reader, row, and decoder test files (49 tests) and they pass.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: ready for review (stacked on #23451)

Head: 2fbccd01a7. CI: 30 passed, 12 skipped, 0 failed.

What this fixes. In terminal-based chats (the agent runs as its normal CLI and Orca renders its transcript as a chat), a multi-question ask left a row reading "Asked: 2 questions". The questions and answers were shown nowhere. The row now opens to list every question in full. Under each question it shows the answer, but only when the agent's own result record matches a shape Orca recognizes. Otherwise it shows the questions alone, so an unfamiliar format never produces a wrong answer:

  • Claude: answers come from Claude's structured result record. That includes typed "Other" answers and notes. If the user replied in free text instead of answering, or the prompt timed out, only the questions are shown.
  • Codex: answers come from its JSON result, keyed by question id. A secret question's answer is never shown.
  • Grok: only prose is recorded, so questions only.

Review loops. Five review loops plus one architecture challenge.

  • Readiness check (start): found that the new answer field skipped the size limits on the mobile and agent-transcript payloads. The agent-transcript path also skipped dispatch-token redaction. Loop 2 fixed this: both payloads now drop the field, since neither reads it. Paired desktop and web keep it.
  • Loop 3: aligned Claude's answer rules with how Claude itself records notes, a notes-only placeholder, free-text replies and timeouts.
  • Architecture challenge: because of the repeated findings, a separate agent challenged the design. Verdict: keep, with four changes.
    • an answer is shown only when the whole result matches a recognized shape
    • the Codex parser is chosen by tool name
    • each agent's answer rules live in one file
    • tests use shapes taken from real records
  • Loop 4: applied those four changes.
  • Loop 5: clean. It ran the rules over every Claude ask result on the reviewer's machine: all 270 answered results showed their answers and none of the 65 declined ones did. It also ran them over the local Codex outputs.

Readiness checks. Start and end both passed. The end check found no issues.

Live QA, on a background dev build of this head on a second Mac with an isolated profile, using real terminal-backed Claude and Grok chats. Passed:

  • Claude two-question ask with an option answer and a typed answer, including selecting text
  • a short single question opening to its answer
  • a declined ask
  • Grok questions-only
  • keyboard (Tab, Enter, Space)
  • scroll away and back
  • a single long question

Screenshots are in the PR body. Codex was blocked: the CLI on that machine never produced a question, because its account was near its usage limit. Codex answers are covered by tests only.

Two gaps QA found. Both are unchanged from main, and neither is caused by this PR:

  • Declined or "Chat about this" asks. When the user picks Claude's "Chat about this" (reply in free text) or declines, Claude records the ask as an error. The chat shows a failed tool line instead of an "Asked" row, so the questions can't be opened the way they can in structured chats, where a cancelled ask lists them after fix(native-chat): let a multi-question ask record list its questions #23451.
  • Pending label. While Claude's question card is up, the terminal chat's row reads "Asked:" rather than "Awaiting user input:", because the terminal lane marks the turn as waiting, not working.

Other known behaviour:

  • A multi-select answer Claude stored as one string shows as "A, B", and one stored as a list shows as "A · B". Almost all real answers are strings.
  • A desktop paired with an older remote host shows Claude questions without answers. Codex answers still appear there.
  • Chat history imported into a structured session shows Claude questions only.

Not caused by this PR (follow-ups):

  • File-edit patches have the same payload-size gap on the mobile and agent-transcript paths.
  • Codex refusals and aborts, and Grok failures, still show as "Asked" rows.

@brennanb2025
brennanb2025 marked this pull request as draft September 27, 2026 22:18
…hat-multi-question-terminal

# Conflicts:
#	src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx
#	src/renderer/src/components/native-chat/NativeChatResolutionReceipt.tsx
#	src/shared/native-chat-ask-row.test.ts
#	src/shared/native-chat-ask-row.ts
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/native-chat-multi-question-structured to main September 28, 2026 20:42
@brennanb2025
brennanb2025 marked this pull request as ready for review September 28, 2026 23:12
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Displays recorded answers to user questions in the chat UI.

The PR should not merge until Claude answer data is attached to the correct result in multi-result records.

Findings

  1. P1 Claude answers attach to wrong result ▶
  2. P2 Literal reply is discarded ▶

Summary

The PR expands terminal-chat ask rows to list questions and recognized recorded answers. It adds shared Claude and Codex answer readers, carries Claude answers through transcript decoding, and omits the new field from mobile and worker payloads. The Claude decoder’s positional result attachment needs correction for multi-result records.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Agent transcript] --> B[Decode tool calls and results]
  B --> C[Pair ask call with result]
  C --> D[Read recognized answer data]
  D --> E[Expandable question row]
  B --> F[Mobile and worker payloads]
  F --> G[Omit askAnswers]
Loading

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

Comment on lines 69 to +74
return blocks.map((block) => {
if (attached || block.type !== 'tool-result') {
return block
}
attached = true
return { ...block, editPatch: patch }
return { ...block, ...data }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Claude answers attach to wrong result

If a Claude result record contains several tool_result blocks and the ask result is not first, this code attaches the recorded answers to the first result anyway. The question row reads the result paired with the ask call, so it cannot show those known answers.

Comment on lines +90 to +93
(part): part is string =>
typeof part === 'string' && part.trim().length > 0 && part !== CLAUDE_NOTES_ONLY_ANSWER
)
if (parts.length > 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Literal reply is discarded

If someone types (notes only) as their answer, this filter removes it even when there is no note annotation. The row then shows an answered question without its recorded reply. Only treat that text as a placeholder when a corresponding note exists.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f37df953-4544-4769-9524-4303617de416

📥 Commits

Reviewing files that changed from the base of the PR and between 409462a and 461fcd2.

📒 Files selected for processing (17)
  • src/main/native-chat/transcript-line-decoders-claude-ask-answers.test.ts
  • src/main/native-chat/transcript-line-decoders-claude.ts
  • src/main/runtime/orchestration/worker-transcript-payload.test.ts
  • src/main/runtime/orchestration/worker-transcript-payload.ts
  • src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.test.ts
  • src/main/runtime/rpc/methods/native-chat-rpc-block-sanitize.ts
  • src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx
  • src/renderer/src/components/native-chat/NativeChatResolutionReceipt.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/native-chat-resolution-receipt.ts
  • src/shared/native-chat-ask-answers.test-fixture.ts
  • src/shared/native-chat-ask-answers.test.ts
  • src/shared/native-chat-ask-answers.ts
  • src/shared/native-chat-ask-row.test.ts
  • src/shared/native-chat-ask-row.ts
  • src/shared/native-chat-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Claude and Codex answer parsing and carries recorded answers in native-chat tool-result data. Ask-row aggregation matches answers to questions, and the renderer displays recorded answers in expandable rows. Transcript bounding and mobile RPC sanitization omit answer data. Tests cover parsing, decoding, sanitization, aggregation, and display.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 461fc

Expanded ask rows now show every question, with recorded answers when the agent's result matches a known format. Phone and worker payloads omit the new field. No concrete merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 461fc

Recorded answers can now appear in chat history. Mobile and worker payloads exclude the new answer field, and secret questions have a display guard. However, if results arrive out of order or are replayed, an answer could appear under the wrong question, potentially under a non-secret question.

Retained concerns

  • Medium · security · inferred: Ordinal call/result pairing can display a recorded answer under the wrong ask when results are reordered or replayed. If question IDs or text repeat, the secret-question display guard is applied to the receiving ask rather than the answer’s originating ask.
Security review details

Security Blast Radius

  • inferred — The new answer-display exposure is in native-chat transcript views and non-mobile consumers that retain tool-result blocks. The changed sanitizers prevent the separate structured field from expanding mobile or bounded worker payloads.

Security Findings and Attack Paths

  • inferred — A reordered or replayed transcript result can be assigned to a later ask by ordinal. When that ask reuses a Codex question ID or Claude question text, its row can display the earlier answer; the receiving ask’s secrecy flag controls display. The evidence does not establish that a production producer emits such ordering.

Trust Boundaries and Controls

  • observed — The answer parsers reject unrecognized result shapes and answer keys outside the requested questions. The row builder separately suppresses answers for matched questions marked secret; neither control verifies that the paired result originated from that ask call.

Resilience and Maintainability Implications

  • inferred — Making previously undisplayed answers visible raises the consequence of the existing FIFO pairing assumption. Missing and errored results have question-only or excluded paths, but reordered and replayed successful results lack an ownership check.

Hardening Proposals

  • proposed — Bind a displayed answer to a verifiable originating call, or establish and enforce FIFO ordering at the producer. Where ownership cannot be verified, retain the question-only display.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 17 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: terminal-chat ask rows now list every question and display known answers.
Description check ✅ Passed The description is detailed and covers the required ELI5, changes, rationale, testing, visual proof, compatibility, security, and checklist sections. It lists “None” instead of a linked issue, leaves …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since 2fbccd0 — commit 461fcd2, a merge of origin/main. No file owned by this PR changed; the merge added unrelated main work (a journalPosition strip in worker-transcript-payload.ts, an AgentSessionFailureFact on text blocks) and left the terminal-ask behavior identical.

  • Prior open thread resolved — the Codex isSecret reachability ask is withdrawn. Codex's RequestUserInputQuestion does define isSecret (codex-rs/protocol/src/request_user_input.rs), but every producer copies it from the model arguments and nothing sets it true, and the transcript records the raw model-authored function_call.arguments. So source?.isSecret === true fires only on a model-authored field and fails safe otherwise. The thread is resolved and answered inline.
  • Strip placements survived the merge — the PR-owned askAnswers removal in boundBlock (worker-transcript-payload.ts:127) and the mobile branch (native-chat-rpc-block-sanitize.ts:54) are intact; the merge's extra journalPosition strip is orthogonal.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

This branch has not been deployed

No deployments
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