Skip to content

🤖 feat: keep open ask_user_question forms sticky above the chat input - #6887

Open
ammar-agent wants to merge 1 commit into
ask-user-question-occurrencesfrom
ask-user-question-dock
Open

ammar-agent wants to merge 1 commit into
ask-user-question-occurrencesfrom
ask-user-question-dock

Conversation

@ammar-agent

@ammar-agent ammar-agent commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #6891, which tells apart ask_user_question rows that reuse a tool call id. This PR keys the dock, the transcript stubs and the accepted answers by transcript row on top of that.

Summary

Open ask_user_question forms now dock above the chat input, inside the sticky composer dock, so they stay pinned to the bottom of the chat. The question's transcript row becomes a one-line stub ("Answer in the panel above the chat input."), and once the questions close, the row shows the outcome as before.

Background

A non-blocking (Exec) question stays answerable while the agent keeps working. Later output pushed the form off screen, and hyper-density work bundles could collapse it. A blocking (Plan) question also scrolled away when the user scrolled up to read context. CSS position: sticky on the card itself can't solve this: its containing block is only as tall as the card's own row, and rows can unmount (detached slices) or be collapsed into bundles.

Implementation

  • askUserQuestionPlacement.ts: findOpenAskUserQuestions is a single-pass selector that mirrors the card's own isAnswering logic. A blocking question counts as open while its call is executing. A non-blocking one stays open until an answer row lands or a compaction boundary drops it. The file also adds a placement context (inline | transcript | dock).
  • AskUserQuestionDock is a composer decoration (self-gating, keyed by workspace). It renders open questions through ToolMessage, so lazy tool cards and arg validation still apply. It is capped at max-h-[50vh] and scrolls when the content is taller, which keeps the composer on screen on phones.
  • Only one form instance ever exists. ChatPane marks docked ids for the transcript, and the registered PlacedAskUserQuestionToolCall renders a stub for them. Ids from both the immediate and the deferred transcript count, so a lagging deferred row can't flash a second form.
  • After its questions close, a docked card stays mounted (rendering nothing) until no submit is in flight and its blocking-answer auto-retry rollback has settled. It then releases itself and the dock unmounts it, so closed cards don't pile up.
  • Accepted non-blocking answers now live in a small in-memory store keyed by workspace and question row, for the app session. Before, they were per-card state. The dock, the transcript stub and any remounted card all read the store, so they agree a question is answered even when no answer row ever lands, as when the answer is batched into a queued message. This also stops the form from reappearing and taking a duplicate answer after a remount.
  • The dock never renders hook output; that stays on the transcript row.
  • Hosts without a dock (VS Code webview, sub-agent dialogs, stories) keep the inline default and render as before. The transcript placement is also scoped by workspaceId, so nested transcripts are unaffected.
  • The dock skips the decoration reveal gate (revealBeforeReady, like the queued message), so a form never moves between instances mid-answer. Transcript-only workspaces have no composer, so their transcript keeps the full card.
  • Rows whose args fail the schema render as the generic card and are never docked.
  • The dock, the transcript stubs and the accepted answers are keyed by transcript row id, not by tool call id. The open check uses 🤖 fix: tell apart ask_user_question rows that reuse a tool call id #6891's getAskUserQuestionOccurrences, the same state the card reads, so the dock and the card can't disagree about whether a question is open.

Validation

  • New Storybook plays (App/AskUserQuestionDock Desktop + 390px Phone): the form renders exactly once, inside chat-composer-dock, with no horizontal overflow. I also checked desktop and phone screenshots by eye.
  • Unit tests cover the selector (blocking/non-blocking/answer-row/boundary cases), the placement gating, the stub vs. form, cross-workspace scoping, and the docked card rendering nothing while staying mounted for the rollback.

Risks

Low to moderate, limited to ask_user_question UI. One behavior change: after you answer, the transcript row remounts and follows the per-tool expand preference (collapsed by default) instead of staying expanded. This matches what you'd see after a reload.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $n/a

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T20:31:31.115082Z 834aa9f Manual request
🔒 Security Review ✅ Completed 2026-10-16T20:32:43.983318Z 834aa9f Manual request
ℹ️ About Codex in GitHub

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

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

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

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: bff2bd6133

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bff2bd6133

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Tools/AskUserQuestion/askUserQuestionPlacement.ts Outdated
Comment thread src/browser/components/ChatPane/AskUserQuestionDock.tsx Outdated
Comment thread src/browser/components/ChatPane/AskUserQuestionDock.tsx
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9bb2cec6b5

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the hook-output finding; please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 2caedc26b9

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2caedc26b9

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the retained-card finding; please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 5d37ca9003

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the accepted-answer finding; please take another look.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Rebased onto main and addressed the accepted-answer finding; please take another look.

@ammar-agent
ammar-agent force-pushed the ask-user-question-dock branch from 3735a21 to b6eb9b6 Compare October 16, 2026 16:30
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b6eb9b64e6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6eb9b64e6

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/components/ChatPane/AskUserQuestionDock.tsx
Comment thread src/browser/components/ChatPane/AskUserQuestionDock.tsx Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the reused tool-call id finding; please take another look.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the malformed-args finding; please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e07f518ef8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e07f518ef8

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Tools/AskUserQuestion/useNonBlockingQuestionAnswers.ts Outdated
Comment thread src/browser/stories/App.askUserQuestionDock.stories.tsx
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Replied on the Pixel finding: the snapshot budget is at its cap, 687/687 snapshots and 120/120 files. Please take another look.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Replied on the accepted-answer key finding: toolCallId is the existing cross-layer identity for non-blocking answers, so this is not a regression from this PR. Please take another look.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e07f518ef8

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/components/ChatPane/AskUserQuestionDock.tsx Outdated
Comment thread src/browser/components/ChatPane/ChatPane.tsx
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e07f518ef8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the reveal-swap and reused-id release findings; please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 685c98491e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 685c98491e

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Tools/AskUserQuestion/askUserQuestionPlacement.ts Outdated
Comment thread src/browser/components/ChatPane/ChatPane.tsx
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the stale blocking-answer finding; please take another look.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Aligned the selector's boundary check with the card's; please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3199df2365

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3199df2365

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Tools/AskUserQuestion/askUserQuestionPlacement.ts Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Pausing the Codex review loop for human direction (AGENTS.md early-stop case 2: the loop isn't converging).

The last several rounds all came from one area: tool call ids that a provider reuses inside one workspace. Each fix turned up the next edge in that area (dedupe, every row, latest row, boundary row). The root cause is older than this PR: across layers, a non-blocking question is identified by toolCallId alone (answer-row metadata, the answer message the model reads, hasAskUserQuestionLeftContext, findLatestAnswerRow, draftStateCache). Reused ids already collide on main.

What this PR does: it treats a tool call id as one question, judged by its latest row. Every open check is the card's own, so the dock and the card can't disagree, and release/reconcile can't loop.

Deferred follow-up (separate PR): give non-blocking answers a per-occurrence identity (row id in the answer metadata and the left-context lookup), or reject or rename reused ids at ingest. Either one would make the reused-id edges go away at the source.

Everything else from review is addressed. Over to a maintainer: either accept this scope, or ask me to take on the identity change here.

@ammar-agent
ammar-agent force-pushed the ask-user-question-dock branch from 3199df2 to 834aa9f Compare October 16, 2026 20:27
@ammar-agent
ammar-agent changed the base branch from main to ask-user-question-occurrences October 16, 2026 20:27
@ammar-agent
ammar-agent added this pull request to stack #6893 October 16, 2026 20:27
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Resuming the review loop. The reused-tool-call-id problem now has a root-cause fix in #6891, which sits below this PR in the stack. That PR identifies each ask_user_question row by position: an answer belongs to the latest earlier row with its id, and a later row with the same id replaces the earlier one. This PR now keys the dock, the stubs and the accepted answers by row id. The getLatestAskUserQuestionRows workaround is gone.

That also resolves the earlier deferred threads:

  • A reused id after a boundary: the latest row is judged by its own position, so it stays open.
  • Accepted answers keyed per occurrence: they're now keyed by row.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 834aa9f615

ℹ️ About Codex in GitHub

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

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

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 834aa9f615

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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