fix(web): unblock ask_user selections in developer/machine chats - #2238
fix(web): unblock ask_user selections in developer/machine chats#22382witstudios wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change extracts ask-user answerability into an exported helper, removes transport-status gating from the hook, and adds tests for pending, non-latest, and completed ask-user tool calls. ChangesAsk-user answerability
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc6b247b06
ℹ️ 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".
| } | ||
| return ids; | ||
| }, [messages, status]); | ||
| const answerableToolCallIds = useMemo(() => getAnswerableAskUserToolCallIds(messages), [messages]); |
There was a problem hiding this comment.
Disable the question once answer submission starts
When a user submits an answer, addToolResult updates only the transport message and auto-resumes the chat, while the store-backed messages passed by these surfaces can retain the pending input-available part throughout the submitted/TTFB window. Because answerability now depends only on that unchanged array, the Submit button remains enabled and a second click invokes wrapSend again; useSendHandoff has no duplicate-send guard, so this can start duplicate agent resumptions and repeat billed or side-effecting tool work. Preserve the fix for stale cross-surface status, but add a conversation/tool-call-scoped submitting guard that removes the ID as soon as submission begins.
Useful? React with 👍 / 👎.
|
Closing as superseded.
So there's no longer a diff for this PR to make. Merging it as-is would either resurrect a dead, unused file or resolve to a no-op against master's deletion. Separately: while verifying this, we found the ask_user answerability fix from #2112 was only wired into |
|
Codex couldn't complete this request. Try again later. |
Summary
status === 'ready'gate from ask_user answerability computationtool-ask_userparts on the last assistant messageRoot cause
useAskUserAnsweringrequired transportstatusto bereadybefore exposing answerable tool call ids. In complex surfaces (mode switches / machine/developer contexts), status can be surface-local or stale relative to the rendered conversation, causing ask_user cards to render in a disabled state (not-allowedcursor) even when the last message has a pendinginput-availablequestion.Changes
apps/web/src/lib/ai/shared/hooks/useAskUserAnswering.tsgetAnswerableAskUserToolCallIds(messages)helperapps/web/src/lib/ai/shared/hooks/__tests__/useAskUserAnswering.logic.test.tsVerification
bun run test src/lib/ai/shared/hooks/__tests__/useAskUserAnswering.logic.test.tsbun run lint(warnings only, pre-existing)bun run typecheckinapps/webcould not complete in sandbox (tool execution failed/timeout despite increased memory and timeout)Summary by CodeRabbit
Bug Fixes
Tests