Skip to content

Keep async question controls available after agent notices - #35758

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/sta-12421-async-question
Oct 30, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/sta-12421-async-question

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​182 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​154
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 0

An active Codex async question could lose its choice buttons and free-text answer control when another agent sent a notice. The notice was a user-role transcript row, and the pending-question scanner treated it as the person's answer even though sender metadata identified it as agent-origin.

Keep the existing async question card available across recognized agent-origin messages on desktop and mobile. Human and legacy messages, the five existing send-exclusion flags, and interruption keep their existing behavior. No saved fields or wire changes are added.

Tracked in STA-12421; tracked in #34357. This change is based on #34368 by gentslava.

Review path: full path. This repeats a missing-answer-card bug in the mechanism introduced by #31652 and changes mixed-version question settlement. The shared sender-aware condition preserves ordinary human-message settlement and independently updated hosts. The adjacent blocking-question FIFO reset remains outside this async change; tracked in STA-12765.

Differences from the common pattern:

  • Transcript-derived pending identity: intended. Orca's existing contract treats ordinary human messages outside the card as answers, including on mixed-version hosts without an explicit question-response record.
  • Missing sender metadata: intended, backwards compatibility. Such messages retain their existing settlement behavior; a legacy agent notice without sender metadata cannot be distinguished from a human message.
  • Existing answer and dismissal behavior: intended. Ordinary human messages outside the card still settle prior async questions; optimistic human rows and accepted card sends can hide controls before confirmed receipt. Cancel only hides the current card locally, and no timeout is added. These existing behaviors remain unchanged; this PR restores controls across recognized agent notices.

Validation: the shared regression covers real-shaped agent notices, null/unknown orchestration metadata, empty senders, repeated scans, human/legacy settlement, interruption and all five send-exclusion flags. Extended desktop and mobile consumer tests cover notice arrival followed by an ordinary answer; desktop also preserves an existing selection and drafted free text. Source review found no production defect. CI passed on the final head cabd281 after the consumer-test commit and main merge. Execution evidence confirms the shared scanner (15 tests), desktop renderer (2), mobile hook (13), and shared sender/projection contracts (47) passed. Static analysis/typecheck and all ten unit shards also passed. Quick branch screenshots passed on this head: the desktop production-component fixture retained controls and accepted custom text after projected agent mail; the shipping iOS app retained choices and accepted an unsent custom answer after the structured journal notice. The iOS app uses its production WebView shell and branch workspace bundle; no external browser or substitute screen was used. These fixture captures have no agent under test and do not claim answer transport. Desktop capture, mobile after notice, mobile loaded question. This is the native-chat UI tests row; no process/lifecycle change requires a full agent QA round. This dependency-free checkout has run no local tests or typecheck, and its generated pre-commit entry is absent; normal commits did not bypass hooks. Actual validation is provided by CI and the admitted screenshot runs.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 29, 2026 07:17
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Keeps async question controls available after recognized agent notices.

  • Async question controls stay open when another agent sends a notice.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 022874f8-2a21-4913-b6ea-613950058312
Commits

Reviewing files that changed from the base of the PR and between 0e9ba21 and f3f248e.

Files selected for processing: 2
  • src/shared/native-chat/input/native-chat-ask.test.ts
  • src/shared/native-chat/input/native-chat-ask.ts

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

Walkthrough

The pending-ask scan now keeps an async ask open when a reached message comes from an agent. It still clears the ask on interruptions and on reached messages that are not from an agent. Tests cover multiple agent-notice source shapes, human-row states, and both pending-ask extractors.

Priority: Normal

Merge Risk: Minimal · up to f3f24

Recognized agent notices preserve question controls. No merge-blocking issue was identified; the relevant tests still need to run.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "Keep async question controls available after agent notices" matches the main change: recognized agent-origin transcript messages no longer settle an active async question, so the question c…
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.
Description check Passed The description is detailed and covers the change, rationale, behavior, testing evidence, visual proof, compatibility, and validation limits. It does not use the template headings or provide an actual…
Full details: Title check

Explanation

The title "Keep async question controls available after agent notices" matches the main change: recognized agent-origin transcript messages no longer settle an active async question, so the question card and its controls stay available. It is specific and concise, and the diff (scanPendingAsks in native-chat-ask.ts plus focused tests) supports it.

Full details: Description check

Explanation

The description is detailed and covers the change, rationale, behavior, testing evidence, visual proof, compatibility, and validation limits. It does not use the template headings or provide an actual linked issue URL; it only references issue numbers and states that the change is tracked there.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copy link
Copy Markdown
Contributor Author

An active Codex async question lost its answer buttons and free-text control when another agent delivered a notice. The notice used the provider's user role, so the pending-question scan mistook it for the person's answer. This PR keeps the existing desktop and mobile card available across recognized agent-origin messages while preserving human/legacy-message settlement, delivery exclusions, and interruption.

The full review path found no remaining production defect. Correctness and architecture review, a continued consumer-test review, final reference/readiness checks and a dedicated performance pass are complete. A three-seat budget re-plan kept the same design and justified the required consumer coverage; no extra state, wire operation, scan or subscription was added. Intended compatibility and existing dismissal behavior are labelled in the PR description.

Verified on cabd281606e1da3a1590925192fff415a35d4512: CI and Mobile verify passed. Exact execution evidence confirms 77 tests across the shared scanner (15), desktop consumer (2), mobile hook (13), and shared sender/projection contracts (47). The desktop regression keeps an existing selection and drafted text across projected mail, then checks ordinary sends and human settlement; mobile checks its existing send outcomes. All ten unit shards and static analysis/typecheck passed. Main was synced once before this final validation.

Deferred: minor test-fixture duplication and repeat-scan wording nits. The separate pre-existing blocking-question FIFO issue is tracked in STA-12765. Missing sender metadata retains legacy settlement as described in the PR. This changes the native-chat UI tests row; no process/lifecycle flow or real-agent QA round is involved.

For Brennan's review

Desktop production-component fixture after projected agent mail, on the reviewed head. The mounted wrapper retained its controls and accepted custom text; no answer was sent. This is component evidence, with no agent under test.

Desktop async question retained after agent notice

Shipping iOS app on the same head, reached through onboarding, pairing and workspace navigation. Its production WebView shell loaded the branch workspace bundle; this is the screen that ships inside the native app. After the synthetic journal delivered the recognized agent notice, the card retained its choices and accepted an unsent custom answer with Submit enabled. Keyboard closed; zero answer sends. This is screenshot-fixture evidence, with no agent under test or answer-transport claim.

Mobile async question retained after agent notice

Loaded mobile question before the notice

Judgment spots: sender-aware settlement, projected notice through desktop controls, mobile notice-to-answer coverage.

@brennanb2025
brennanb2025 merged commit f26fb1c into main Oct 30, 2026
50 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/sta-12421-async-question branch October 30, 2026 05:34
AmoabaKelvin added a commit that referenced this pull request Nov 16, 2026
…uestion card

Skip on a Codex async question card now saves the skipped row on the chat's host
record (agentSession.skipAsyncQuestions, modelled on cancelUsageLimitContinue), so
the status, the desktop card and the phone card all honour it. The host status read
no longer ends at another agent's message, matching the card's rule from #35758;
two partial indexes, created without a schema version bump, keep that read bounded.
AmoabaKelvin added a commit that referenced this pull request Nov 16, 2026
…on card (#42946)

* fix(native-chat): make Skip and agent messages agree with the async question card

Skip on a Codex async question card now saves the skipped row on the chat's host
record (agentSession.skipAsyncQuestions, modelled on cancelUsageLimitContinue), so
the status, the desktop card and the phone card all honour it. The host status read
no longer ends at another agent's message, matching the card's rule from #35758;
two partial indexes, created without a schema version bump, keep that read bounded.

* fix(native-chat): gate phone Skip on relay support; roll back only its own hide
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