Skip to content

fix(native-chat): replace the raw question tool row with an awaiting-input row - #20724

Merged
brennanb2025 merged 12 commits into
mainfrom
brennanb2025/fix-native-chat-ask
Sep 15, 2026
Merged

brennanb2025 merged 12 commits into
mainfrom
brennanb2025/fix-native-chat-ask

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​652 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​648
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​454 $\color{#cf222e}{\Huge{\mathbf{−}}}$​52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​402

What this changes

A question tool call rendered as ordinary tool activity in the chat log: Running AskUserQuestion with a clipped JSON payload while live, then a 1x AskUserQuestion {"questions":[…]} run header once settled. We already render a card for the reader to answer, so the one row they actually have to act on was the one reading as machine output.

It now draws as a plain row:

  • Awaiting an answer — Awaiting user input: <question>, led by a comment-bubble glyph, with the label pulsing while the answer is outstanding. Uses the same animate-pulse every other live row in native chat already uses, and drops the motion under prefers-reduced-motion.
  • Once answered — Asked: <question>, no pulse. A row that still claimed to be waiting would be saying something false.
  • A grouped prompt names how many questions it asks instead of quoting only the first, because one row stands for the whole prompt.

Why Codex needed more than a re-skin

The two agents do not behave the same way, so a renderer-only fix would have covered one of them:

  • Claude journals the ask as an ordinary tool call, and that is what rendered raw.
  • Codex journals only the question and never a call for it, and a pending question was dropped from the transcript entirely. Its chat log said nothing while the agent sat blocked on the reader.

Where the row is derived

Question presentation is client-local. The shared journal projection is left untouched, so archives and older RPC consumers keep the projection they already had — the desktop transcript derives its own rows in structured-agent-question-projection.ts.

A pending question keeps a stable identity row through tool folding while its receipt draws the awaiting line. The duplicate AskUserQuestion call Claude journals beside the question it raised is suppressed when a matching question item is present in the same turn, so an unmatched call — or one from a lane that journals no question at all — still reports itself.

Two further behaviours fall out of that:

  • Question calls leave the run together with their FIFO-paired result, so a summarized ask no longer strands its answer as an orphan Result row, and the N× count beside them reports only the work that actually ran.
  • A failed ask keeps its error instead of being folded into the awaiting row, and an ask no longer contends with a concurrently running tool for the active slot — both are reported.

Adjacent pending questions — the shape Codex journals, one item per question — group into a single awaiting row that narrows as each one is answered.

Localization

The three row strings take their translate() fallback from a shared constant rather than a string literal (the existing pattern in this folder, so the desktop fallbacks and mobile cannot drift). i18next cannot rebuild a value from a non-literal call-site default, so they also ship in en-runtime-required.json; without that the static-analysis gate fails.

Tests

  • src/shared/native-chat-ask-row.test.ts — single vs grouped subject, Codex's JSON-string arguments, the per-question calls Codex journals for one prompt collapsing into a single row, and an ask whose payload names no question still drawing the row.
  • src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts — a pending question gets a row, a grouped prompt prefers its own question list, matched duplicates are suppressed while failed and unmatched calls survive, turn boundaries are respected, and the host projection is left unchanged.
  • src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx — both states from the report, the header count beside an ask, a pending question alongside another running tool, a failed ask preserving its error, and no stale state after a turn stops.
  • src/renderer/src/components/native-chat/NativeChatMessageList.turn-history.test.tsx — end to end: the row and its question render with request_user_input absent, resolution swaps to Asked: with the answer, and Codex's separate question items collapse to one 2 questions row that narrows after a single answer.

Two existing tests used AskUserQuestion as a stand-in for an unmodelled tool; it is modelled now, so they were moved to a genuinely unmodelled name and still test what they meant to.

Validation

pnpm tc, 94 tests across the six affected files, the full pnpm lint chain (all four localization gates, max-lines ratchet, anti-slop rules) and the changed-code quality gate all pass. An independent review pass ran readiness checks at both ends and captured visible proof in the app.

Residual risk and follow-ups

  • Duplicate suppression matches on normalized question text within an inferred turn. Two genuinely identical prompts inside one turn could collide and have a row suppressed.
  • Mobile is unchanged and still renders the raw row. The copy and subject derivation live in src/shared/native-chat-ask-row.ts so mobile can read the same strings; wiring it is a follow-up.

@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 — the full 12-file diff at 245c873, tracing the ask row from derivation through both the native and structured transcript paths.

  • Shared ask-row derivation — native-chat-ask-row.ts resolves the row from the tool name alone (so an unparseable payload still draws the row) and aggregates subjects across every ask call in a run, which collapses Codex's one-call-per-question items after folding merges them.
  • Tool-input parsing — parseAskFromToolInput decodes JSON-string arguments before the registered-parser dispatch, matching how live status is parsed.
  • Awaiting-input row — new component renders Awaiting user input:/Asked: with the pulsing label under prefers-reduced-motion, a grouped prompt reporting its question count, and the shared message-square-more glyph.
  • Run header accounting — NativeChatToolRun filters ask calls out of headerBlocks, so they leave both the N× count and the Running … active row, and suppresses the header entirely for an ask-only run.
  • Structured projection — pending question items now project to a request_user_input running call instead of null, and AskUserQuestion tool-call items are dropped so Claude's call+question pair draws one row.

I confirmed the pending state stays truthful in production: activeTurnIsWorking remains true while a question blocks the turn (use-structured-agent-session.ts:110 keeps turnId, and the turn record is still running), so the structured row reads Awaiting rather than Asked. The projection change is also order-safe for the worker cursor — structuredJournalPrefixIdentity filters with the same projectStructuredItemToNativeChat, so message index and item index stay aligned. The two renamed tests move AskUserQuestion to a genuinely unmodelled name, preserving their original intent. The new tests use exact assertions (animate-pulse class, exact subject objects, 1×), so they would fail if the behavior regressed. pnpm test on the four new/changed suites (55 tests) and the localization extraction gate both pass.

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review complete on 9e01ce6.

  • Reviewed both commits, including architecture and concurrency behavior.
  • Independent review found no material regressions or valuable fixes.
  • Targeted tests pass: 13/13; typecheck passes (pnpm tc).
  • Runtime-required English catalog fix is present on the new head.
  • Electron visible-proof and final readiness checks were run; see review report for evidence and residual risks.

Verdict: pass with residual risk. Duplicate suppression uses normalized question text within an inferred turn; distinct identical prompts in one turn could theoretically collide. Mobile raw-row rendering remains the known deferred follow-up.

@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 — the delta at 9e01ce6, the only commit since the prior pullfrog review, read against the full 18-file net diff.

  • Moved question presentation out of the shared projection — the new renderer-local structured-agent-question-projection.ts now owns the pending-question row and ask-call suppression, injected into projectStructuredAgentSessionMessages through a new optional projectItems parameter. The shared projection is reverted to byte-identical with main (git diff --merge-base origin/main over structured-agent-session-projection.ts and structured-agent-session-message-projection.ts is empty), so the host/archive/worker-RPC lane and its structuredJournalPrefixIdentity message↔item index pairing are untouched — this resolves the cross-lane divergence the first commit introduced.
  • Ask-run accounting reworked — nativeChatAskRunBlocks pairs each ask call with its FIFO result and removes both from the run's work while preserving failed calls and errored results; NativeChatToolRun derives the header count, the active call, the settled glyph, and the member rows from work only, so an ask-only run draws no 1×.
  • Awaiting/Asked row wired into receipts — NativeChatResolutionReceipt renders the pending awaiting row and the settled Asked: row for question bodies; NativeChatAwaitingInputRow carries the copy, message-square-more glyph, pulse, and motion-reduce:animate-none.
  • Tests — projection, grouping, suppression, failed-call preservation, and row-state coverage added; two AskUserQuestion-as-unmodelled stand-ins moved to CreateWidget.

I re-ran the affected suites (pnpm exec vitest run --config config/vitest.config.ts across 9 files, including the new ask-row, question-projection, turn-history, tool-run, receipt, and hook tests): 110 passed. The new tests use exact assertions (exact subject objects, animate-pulse/motion-reduce:animate-none classes, 1×, Asked: vs Awaiting user input:), so they fail if the behavior regresses. The pending-state truthfulness still holds — the projection keeps a pending question attached to the running turn, so the row reads Awaiting while the agent is blocked and Asked once the turn stops.

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

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 9671e17a-55c1-4fab-8c82-eb8a37c988cd

📥 Commits

Reviewing files that changed from the base of the PR and between 9e857d9 and 7821046.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/NativeChatResolutionReceipt.test.tsx
  • src/renderer/src/components/native-chat/NativeChatResolutionReceipt.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds shared question-call parsing and grouping helpers. Native chat renders awaiting and asked rows with question text or counts, while excluding question calls from tool-work summaries. Structured session projection preserves pending questions, groups adjacent pending questions, suppresses duplicate tool rows, and retains resolved receipts. Session hooks and message lists use the new projection. English translations, icon mappings, and test coverage were added.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 78210

The native question-row behavior is ready to merge; resolved questions no longer hide matching tool-call transcript rows.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.62% 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.
Description check ⚠️ Warning The description explains the implementation, rationale, behavior, testing, validation, and residual risks. However, it does not follow the required template and omits the required Linked Issue, Visual… Add all required template sections. Provide a linked issue using Fixes #...; attach before-and-after visual proof or write N/A with a reason; document manual and automated testing plus tested platforms; complete the AI Disclosure sectio…
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly describes the main change: replacing the raw question tool row with an awaiting-input row in native chat.
Full details: Description check

Explanation

The description explains the implementation, rationale, behavior, testing, validation, and residual risks. However, it does not follow the required template and omits the required Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Add all required template sections. Provide a linked issue using Fixes #...; attach before-and-after visual proof or write N/A with a reason; document manual and automated testing plus tested platforms; complete the AI Disclosure section; complete Review and Agent skill upstream boundary; address Notes items; and complete the required Checklist.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-native-chat-ask branch from 9e01ce6 to 8ee29e3 Compare September 15, 2026 06:00

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 455a450b-166c-46c5-8163-a75bdc751a38

📥 Commits

Reviewing files that changed from the base of the PR and between 9e01ce6 and 8ee29e3610e674e5806ae33a94e4f3f9aee01bad.

📒 Files selected for processing (3)
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +2621 to +2624
"ask": {
"asked": "Asked:",
"awaiting": "Awaiting user input:",
"questionCount": "{{value0}} questions"

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore the approval cancellation label. For approval prompts, NativeChatStructuredSession passes cancelPrompt to NativeChatApprovalCard. The card reads components.native-chat.approval.cancel for the cancel button's aria-label. Since the runtime-required catalog omits this key, translate uses its Cancel default value. The control remains usable, but its accessible label falls back to English instead of the localized value. Restore the key in the runtime-required catalog.

…input row

A question tool call rendered as ordinary tool activity — "Running
AskUserQuestion" with a clipped JSON payload while live, then a "1x
AskUserQuestion {...}" run header once settled — so the one row the reader
actually has to act on read as machine output.

It now draws as "Awaiting user input: <question>", led by a comment-bubble
glyph, with the label pulsing while the answer is outstanding and reading
"Asked: <question>" once it lands. A grouped prompt names how many questions
it asks rather than quoting only the first, since one row stands for the whole
prompt. Question calls also leave the run header, so the count beside them
reports only the work that actually ran.

Codex journals only the question and never a call for it, and a pending
question was dropped from the transcript entirely — its chat log said nothing
while the agent sat blocked on the reader. Pending questions now project the
same row. Claude journals both the call and the question it raised, so the
call itself is suppressed and the one row is fed from one source.
…n item

The first pass fabricated a synthetic `request_user_input` tool call inside the
shared journal projection so that one renderer could serve every lane. That made
a presentation choice on behalf of every consumer of that projection, including
archives and older RPC clients that never asked for it.

Question presentation is now client-local. The shared projection is restored
untouched, and the desktop transcript derives its own rows: a pending question
keeps a stable identity row through tool folding while its receipt draws the
awaiting line, and the duplicate AskUserQuestion call Claude journals beside the
question it raised is suppressed only when a matching question is open in the
same turn — so an unmatched call, or one from a lane that journals no question,
still reports itself.

Question calls now leave the run together with their paired result, which stops a
summarized ask from stranding its answer as an orphan Result row. A failed ask
keeps its error instead of being folded into the awaiting row, and an ask no
longer contends with a concurrently running tool for the active slot: both are
reported.

Adjacent pending questions — the shape Codex journals, one item per question —
group into a single awaiting row that narrows as each one is answered.

Also ships the three awaiting-row strings in the runtime-required English
catalog. Their call-site fallbacks are a shared constant rather than string
literals, so i18next cannot rebuild them from the call site and they have to be
present for the static-analysis gate to pass.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/fix-native-chat-ask branch from 8ee29e3 to 67a1e70 Compare September 15, 2026 06:13
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Note on the review verdict above, which was recorded against 9e01ce6623.

The branch has been rebased twice since, and is now 67a1e7056b. Neither rebase changed this PR's code — both were to pick up fixes for failures inherited from main:

git range-diff across both rebases reports both commits as = (byte-identical patches), so the review verdict carries to the current head rather than describing superseded code.

CI is now green on 67a1e7056b: 27 checks completed, 0 failures, with static analysis, package (windows) and verify all passing.

Residual risk, unchanged: duplicate suppression matches on normalized question text within an inferred turn, so two genuinely identical prompts inside one turn could collide and have a row suppressed. Mobile still renders the raw row and is a deliberate follow-up.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1ff66e6d-8e74-4382-bcc3-e526c5b8d9d9

📥 Commits

Reviewing files that changed from the base of the PR and between 67a1e70 and 9e857d9.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts
  • src/renderer/src/components/native-chat/structured-agent-question-projection.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@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 — the delta at 9e857d9, the only commit since the prior pullfrog review (9e01ce6), read against the full 18-file net diff.

  • Reworked the per-turn question tracker in structured-agent-question-projection.ts from a Set<string> to a Map<string, number> that decrements as each matching AskUserQuestion call is suppressed, so a turn with fewer question items than same-text calls keeps the unmatched calls instead of hiding all of them.
  • Added a projection test asserting that two identical calls beside one question item leave the second call in the transcript ([ask-2, q]); with the old Set it would collapse to [q].

I traced both passes — the turn-scoped counting keyed by the same normalized question key the call carries, and the in-order consumption — and the order-independence, failed-call exclusion, and turn-boundary guard all still hold. pnpm exec vitest run --config config/vitest.config.ts across the four ask-row suites: 26 passed. I also confirmed the runtime-required catalog's drop of components.native-chat.approval.cancel is by design: its only call site passes the identical literal Cancel, so the entry is superfluous, and node config/scripts/generate-runtime-required-english-catalog.mjs passes with no missing keys (1689/14304).

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

@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 — the delta at 4e36989 (two commits since the prior pullfrog review), read against the full 19-file net diff.

  • Corrected the settled heading for a single grouped question in NativeChatResolutionReceipt.tsx: when the prompt's generic label (1 grouped question from Claude) differs from its one question, the settled Asked: row now shows the generic label, leaving the answer line as the only place the specific question text appears — undoing the repetition 9e857d9 had introduced.
  • Kept the specific question text on the pending row, where no answer line exists to carry it.
  • Added receipt tests for both: the settled grouped heading is distinct from its answer line (Libraries? appears exactly once), and the pending grouped prompt names the actual question instead of the generic label.

I traced the three cases through nativeChatReceiptAnswers — settled single grouped (generic heading + specific answer line, matching base main), pending single grouped (specific), and multi-question grouped (count) — and the change is a renderer-local presentation tweak with no wire impact. pnpm exec vitest run --config config/vitest.config.ts on the receipt, projection, and turn-history suites: 23 passed.

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

@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 — the delta at 7821046 (two commits since the prior pullfrog review), read against the full 19-file net diff.

  • Suppressed the answer line's question when it would repeat the receipt's Asked: heading for a single-question prompt, so a Claude legacy-compatible single question (where body.question === questions[0].question) no longer prints the same text twice.
  • Kept the answer question line when it carries new information: the settled generic-label case still shows 1 grouped question from Claude in the heading with the specific question above its answer.
  • Added a receipt test asserting the single legacy-compatible question text appears exactly once (Libraries?), alongside the existing grouped-single coverage.

I traced all four shapes (legacy-compatible single, grouped single, multi-question, flat single) through subject and nativeChatReceiptAnswers; the dedup guard only fires when the texts are byte-equal, so the generic-label and multi-question cases are untouched, and the pending path has no answer line at all. pnpm exec vitest run --config config/vitest.config.ts on the receipt, projection, ask-row, and tool-run suites: 33 passed.

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron UI validation (isolated dev instance)

Attached uncropped screenshots from a background-launched Orca on this worktree (window.api.app.getIdentity() → devRepoRoot=/Users/brennanbenson/orca/workspaces/orca/marlin, devBranch=brennanb2025/fix-native-chat-ask).

JSONL / bridge native chat (existing e2e seed)

Pending Claude JSONL still draws the old tool header, because NativeChatResolvedView hardcodes showTurnStatus={false}:

01-jsonl-pending-ask.png

Structured transcript (the changed desktop row)

Production NativeChatMessageList with journal items, in the live native-chat pane:

Pending — Awaiting user input: Tabs or spaces?

02-pending-awaiting-user-input.png

Grouped — one row: Awaiting user input: 2 questions

03-grouped-2-questions.png

Resolved — Asked: Tabs or spaces? (no pulse) + Spaces / Resolved / Answered on desktop

04-resolved-asked.png

No product console errors. Isolated profile had no agent credentials, so structured rows were seeded journal state in the real Electron native-chat surface rather than a live Claude/Codex session.

@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.

Important

Preserving settled ask calls re-exposes a matched call once its question has been answered, so for the rest of the active turn the transcript draws the ask twice — Asked: <question> beside the receipt's identical Asked: row, or a pulsing Awaiting user input: when the tool result has not landed yet, even though the reader already answered.

Reviewed changes — the delta at 130c02d (the only commit since the prior pullfrog review at 7821046), read against the full 19-file net diff.

  • Narrowed the duplicate-call suppression tracker: a question item now registers its normalized key only while its resolution is pending, so a matching AskUserQuestion call is no longer suppressed once that question is settled.
  • Added a projection test asserting a completed call beside a resolved question leaves both rows in the transcript (['ask', 'q']).

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

@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 — the delta at 66a38eb (two commits since the prior pullfrog review at 130c02d), read against the full 21-file net diff.

  • Settled questions now fold their matching call — structured-agent-question-projection.ts registers a question item's normalized key regardless of resolution, so a matching AskUserQuestion call is suppressed once the question is answered and the receipt's Asked: row is the only one drawn. This resolves the ⚠️ duplicate-row finding from the prior review; I confirmed [turn, call, resolved question] now projects to ['q'], and the updated projection test would fail under the old pending-only gate.
  • nativeChatAskRunBlocks reports unansweredAsks — an ask is only "active" until its FIFO result arrives, and NativeChatToolRun drives the row's pulse from that subset while the subject still comes from the whole run, so a settled call draws a static Asked:.
  • The ask row is no longer gated on structuredActivityUi — nativeChatAskRunBlocks runs unconditionally, and activeTurnIsWorking dropped its showTurnStatus gate in native-chat-transcript-slots.ts, so the bridge view (NativeChatResolvedView, which passes showTurnStatus={false}) replaces the raw AskUserQuestion row and pulses it while the agent is blocked. I traced activeTurnIsWorking's consumers: the header and completed-turn guard stay gated on structuredActivityUi, so the widened scope lands on the ask row only.
  • Bridge-path coverage — a new NativeChatMessageList test exercises a transcript-built ask call settling from a separate folded FIFO tool result, alongside the updated projection test. All 7 affected suites (61 tests) pass.

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

@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 minor suggestion inline.

Reviewed changes — the delta at 15201df (one commit since the prior pullfrog review at 66a38eb), a test-only addition with no production change.

  • Settled-receipt coverage — added a NativeChatMessageList.turn-history.test.tsx case that renders Claude's AskUserQuestion call beside its resolved question and asserts a single Asked: row with no raw call.

The production fix itself is unchanged from 66a38eb, and the projection test (folds a settled matching tool call into its resolved question receipt) still locks it — I re-ran it with the pending-only gate restored and it fails as expected. The one note below is about how much the new test adds on top.

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


render(view([user, call, question]))

expect(screen.getAllByText('Asked:')).toHaveLength(1)

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.

This assertion passes even with the settled-call fold reverted — I restored the old pending-only gate and the Asked: count stayed at 1. The completed-turn guard in NativeChatToolRun hides the preserved call whenever activeTurnIsWorking === false, which the view helper always is (isWorking={false}), so this test does not reach the behavior it is named for. Rendering this case with isWorking true (or an expandOverride that defeats the guard) would make it lock the fold.

Technical details
# The new turn-history case is masked by the completed-turn guard

## Affected sites
- `src/renderer/src/components/native-chat/NativeChatMessageList.turn-history.test.tsx:144` — asserts one `Asked:` row for `[user, call, resolved question]`, but `view()` renders with `isWorking={false}` and no `expandedTurnIds`.
- `src/renderer/src/components/native-chat/native-chat-transcript-slots.ts:86-88` — with `isWorking` and `lifecycleWorking` both false, `activeTurnIsWorking` is false.
- `src/renderer/src/components/native-chat/NativeChatToolRun.tsx:178-189` — the settled run is hidden when `structuredActivityUi && expandOverride === false && isSettled && activeTurnIsWorking === false`, so a preserved call draws nothing either way.

## Evidence
- With `structured-agent-question-projection.ts` restored to the pending-only registration, `structured-agent-question-projection.test.ts` fails (`['ask-1','ask-2','q']`), but this new turn-history test still passes (6/6).

## Required outcome
- The test should be able to fail when the projection stops folding a settled matching call, so the settled path has an end-to-end lock rather than relying on the projection-level test alone.

## Suggested approach
- Give `view` an `isWorking` option and render this case with `isWorking` true, or wrap the messages so `activeTurnIsWorking` is true for the row.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

The review loop is clean at 15201df.

Code review

  • Same-model review and fix/re-review completed with no remaining in-scope findings.
  • Meaningful fixes cover bridge-path question rows, one-to-one duplicate matching, settled receipt folding, and receipt-copy deduplication.
  • The change stays within the native-chat presentation scope and introduces no proven regression or performance issue.
  • Architecture, lifecycle, and precedent review found the implementation fit for the existing ownership and delivery paths.
  • Readiness checklist passes at both the start and end of the session with no P0, P1, or P2 findings.

Validation

  • Native-chat/shared suite: 184 files, 2,024 tests passed.
  • Focused bridge/question suites: 8 files, 74 tests passed.
  • pnpm tc: passed.
  • Changed-code quality: passed with 0 findings.
  • Localization runtime catalog and git diff --check: passed.
  • Electron screenshots for pending, grouped, resolved, and bridge states are attached in the preceding PR comment.
  • Mobile, SSH, and Windows-specific behavioral QA are not applicable to this renderer/shared presentation diff; Windows packaging CI passed.

CI status

  • All eight test shards, typecheck, Linux package, and Windows package passed.
  • The Linux package failure from the first attempt was transient and passed on the failed-job rerun.
  • static analysis fails on both attempts at src/shared/agent-status-legacy-adapter.ts:95 (Reflect.get rejected by the anti-slop rule). That file is untouched by this PR and was introduced by the current upstream base.
  • verify is red only because the required static analysis check is red.

Verdict: the code is ready, but wait for the unrelated upstream static-analysis fix before merging.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Post-merge CI update

The latest run at 852af43 is still red, but the failure moved to an upstream main file:

  • All eight test shards, typecheck, Linux package, and Windows package pass.
  • static analysis fails at mobile/src/test-support/rpc-recording/native-mounting-substitutes.ts:45 because of Reflect.get.
  • verify is red only because static analysis is red.
  • That mobile file is part of the merged main tip (22857cd) and is outside this PR's 21-file native-chat diff.
  • The focused upstream repair is tracked separately in PR fix(lint): replace Reflect.get with typed property access in mounting substitutes #20874; I left it out of this PR to preserve scope.

The native-chat code remains validated and clean. This PR is waiting on the upstream mobile lint fix.

@brennanb2025
brennanb2025 merged commit 60d7939 into main Sep 15, 2026
26 of 28 checks passed
AmethystLiang added a commit that referenced this pull request Sep 17, 2026
Add data-testid to NativeChatQuestionCard's title element and update the
e2e test to query by testid with a text filter. The transcript row also
renders the question text, so the previous test could match either location,
causing flaky results. Gating on the card's own title node ensures the
assertion verifies the card is actually rendered.

Fixes #20724
AmethystLiang added a commit that referenced this pull request Sep 17, 2026
* test: target question card title by testid instead of text

Add data-testid to NativeChatQuestionCard's title element and update the
e2e test to query by testid with a text filter. The transcript row also
renders the question text, so the previous test could match either location,
causing flaky results. Gating on the card's own title node ensures the
assertion verifies the card is actually rendered.

Fixes #20724

* test(browser-history): budget the fastest sample, not p95

The prepare/match budget assertions measure wall clock inside a vitest
worker that shares cores with the rest of the shard, so a slow sample
records a preemption rather than the matcher. CI shard 6/8 measured a
p95 of 3.57 ms against the 2 ms ceiling while the same test passes in
isolation; #18788 already records this file failing the same way.

Assert the fastest sample instead, matching the estimator the palette
matcher budget already uses for the same reason. Ceilings stay at 2 ms.

Measured locally (20 samples per batch): the fastest sample moved
0.05 ms -> 0.08 ms between idle and a 3,374-file parallel run, while
p95 of those same batches swung 0.09 ms -> 0.50 ms.

* test: target question card title by testid instead of text

Add data-testid to NativeChatQuestionCard's title element and update the
e2e test to query by testid with a text filter. The transcript row also
renders the question text, so the previous test could match either location,
causing flaky results. Gating on the card's own title node ensures the
assertion verifies the card is actually rendered.

Fixes #20724
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…input row (stablyai#20724)

* fix(native-chat): replace the raw question tool row with an awaiting-input row

A question tool call rendered as ordinary tool activity — "Running
AskUserQuestion" with a clipped JSON payload while live, then a "1x
AskUserQuestion {...}" run header once settled — so the one row the reader
actually has to act on read as machine output.

It now draws as "Awaiting user input: <question>", led by a comment-bubble
glyph, with the label pulsing while the answer is outstanding and reading
"Asked: <question>" once it lands. A grouped prompt names how many questions
it asks rather than quoting only the first, since one row stands for the whole
prompt. Question calls also leave the run header, so the count beside them
reports only the work that actually ran.

Codex journals only the question and never a call for it, and a pending
question was dropped from the transcript entirely — its chat log said nothing
while the agent sat blocked on the reader. Pending questions now project the
same row. Claude journals both the call and the question it raised, so the
call itself is suppressed and the one row is fed from one source.

* refactor(native-chat): derive the awaiting-input row from the question item

The first pass fabricated a synthetic `request_user_input` tool call inside the
shared journal projection so that one renderer could serve every lane. That made
a presentation choice on behalf of every consumer of that projection, including
archives and older RPC clients that never asked for it.

Question presentation is now client-local. The shared projection is restored
untouched, and the desktop transcript derives its own rows: a pending question
keeps a stable identity row through tool folding while its receipt draws the
awaiting line, and the duplicate AskUserQuestion call Claude journals beside the
question it raised is suppressed only when a matching question is open in the
same turn — so an unmatched call, or one from a lane that journals no question,
still reports itself.

Question calls now leave the run together with their paired result, which stops a
summarized ask from stranding its answer as an orphan Result row. A failed ask
keeps its error instead of being folded into the awaiting row, and an ask no
longer contends with a concurrently running tool for the active slot: both are
reported.

Adjacent pending questions — the shape Codex journals, one item per question —
group into a single awaiting row that narrows as each one is answered.

Also ships the three awaiting-row strings in the runtime-required English
catalog. Their call-site fallbacks are a shared constant rather than string
literals, so i18next cannot rebuild them from the call site and they have to be
present for the static-analysis gate to pass.

* fix(native-chat): preserve unmatched duplicate question calls

* fix(native-chat): avoid repeated grouped question text

* fix(native-chat): keep pending question text specific

* fix(native-chat): avoid repeating single question answers

* fix(native-chat): narrow question receipt subject

* fix(native-chat): preserve settled ask calls

* fix(native-chat): cover bridge ask rows

* fix(native-chat): fold settled ask receipts

* test(native-chat): cover settled ask receipt folding
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…21153)

* test: target question card title by testid instead of text

Add data-testid to NativeChatQuestionCard's title element and update the
e2e test to query by testid with a text filter. The transcript row also
renders the question text, so the previous test could match either location,
causing flaky results. Gating on the card's own title node ensures the
assertion verifies the card is actually rendered.

Fixes stablyai#20724

* test(browser-history): budget the fastest sample, not p95

The prepare/match budget assertions measure wall clock inside a vitest
worker that shares cores with the rest of the shard, so a slow sample
records a preemption rather than the matcher. CI shard 6/8 measured a
p95 of 3.57 ms against the 2 ms ceiling while the same test passes in
isolation; stablyai#18788 already records this file failing the same way.

Assert the fastest sample instead, matching the estimator the palette
matcher budget already uses for the same reason. Ceilings stay at 2 ms.

Measured locally (20 samples per batch): the fastest sample moved
0.05 ms -> 0.08 ms between idle and a 3,374-file parallel run, while
p95 of those same batches swung 0.09 ms -> 0.50 ms.

* test: target question card title by testid instead of text

Add data-testid to NativeChatQuestionCard's title element and update the
e2e test to query by testid with a text filter. The transcript row also
renders the question text, so the previous test could match either location,
causing flaky results. Gating on the card's own title node ensures the
assertion verifies the card is actually rendered.

Fixes stablyai#20724
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