Needs you: a waiting chat shows the question it waits on, not the agent's last message
Leo hit this live: the Needs you list said "Waiting 5m" for a chat and showed the agent's last message, not the question the chat was waiting on.
Takes back #23847: its row falls back to the chat's last reply when acpmux names no question text (a permission, or a question without a prompt). That last reply is what Leo flagged. Here a row never shows it: a permission reads "Waiting for you to allow a tool", anything else the plain waiting line. #23847's question-prompt row stays as it is. #23912 already fixed the turn's waiting line on base, so this PR takes base's version of conversation/waitingOn.ts and adds no change there.
What changes
- Needs you list: sometimes the page has not read a chat's ask yet. That happens with a chat on another computer, a grouped request, or a read that has not come back. The chat used to show as one "Waiting" row whose text was
session.preview, the agent's last reply. Now the row shows what acpmux's session summary says the chat waits on (waitingOnandwaitingPrompt):- A question shows its prompt, with the Decision tag that questions the page has read already get.
- A permission is labeled as a permission: the Approval tag and "Waiting for you to allow a tool". The summary does not say which tool.
- The last message is never shown.
- No "Waiting" with nothing pending: a local chat with no open request and no
waitingOnis no longer listed. A chat on another computer whose daemon reports neither field (an older peer) still shows from its indicator, with the plain "Waiting for your answer" line. - Gallery:
agent-pane.needs-youlistnow has a question from another computer and a permission the page could not read. Each has a last message that must not appear in the list.
The selection lives in needsYou/model.ts (waitsOnPerson, waitingAsk). The fallback line is NeedsYou.tsx askText,.
Choices I made without asking:
- A question keeps the existing Decision tag and a permission the Approval tag, so a row whose ask was not read looks like one whose ask was. I did not add a new tag.
atstill comes from the session'supdatedAt. Only the text and label selection changed.
One new string, needsYou.waitingPermission, is filled in for all 21 locales (machine-drafted, marked needs_review like its neighbours).
Changelog
- Fixed: the Needs you list shows the question a chat waits on (or that it waits on a permission) instead of the agent's last message.
Red / green
Command (fleet): cmux-ci run --class light --script scripts/ci/run-webviews-tests.sh --env "CMUX_WEB_TEST_FILES=test/agent-pane-needs-you.test.tsx\nsrc/agent-session/acpmux/conversation/waitingOn.test.tsx"
- Red on the test commit
83765d677807fc5408e491bd4ec2ffee48039253(keyneeds-you-preview-red-83765d6778): failed as intended (step340cc366e7ede02fc14e7ece): both files failed.agent-pane-needs-you.test.tsxhad 2 of 21 tests fail (the waiting-chat preview test anda chat with nothing pending is not listed as waiting), andwaitingOn.test.tsxfailed its question test - Green on the fix
1905335afa56a1aa8be36fd82da928ace45a2b26(keyneeds-you-preview-green-1905335afa): passed (stepf5d3be51e0333dff96196561): both files pass - App compile check on
1905335afa56a1aa8be36fd82da928ace45a2b26: job16f83e818f837cf89d26f537, passed.
Second round (a chat waiting on a secret, with no pending permission and no waitingOn, must stay listed as "Waiting for your answer"):
- Red on the test commit
e6612852703c0652e55401a717bffc4eedf5f63d(keyneeds-you-secret-red-e661285270, stepd84fb60638f5d9dfc6643fdc): only the new secret test failed, and it failed again when run alone - Green on the fix
7ba9c8f5075b96e671d260297a4d78f46f2a6da9(keyneeds-you-secret-green-7ba9c8f507, step808d7adc4ed30e11cb64bd96): both files pass - App compile check on
7ba9c8f5075b96e671d260297a4d78f46f2a6da9: jobfb3b5f7b666a210b45f1d27b, passed.
Observed / Not run
Observed: the red and green fleet runs above, scripts/web-lint.sh (passed), scripts/cmux-next/prepush-gate.py (no new violations), and cmux-ci compile-check --app (passed).
Not run: the gallery render of the updated agent-pane.needs-you variants (the PR's gallery run covers it), and a live repro in a tagged build. I checked acpmux's waitingOn/waitingPrompt and the status logic by reading the code (hub/views.rs status_indicator, hub/subsession_send.rs waiting_cut), not by running them. The New Tab "needs you" cards (newtab/screenModel.ts sessionCard) also show session.preview for a waiting chat. They are not this popover, so they are left for a follow-up.
Agent session: cosmic-gray
🤖 Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the Needs you list showing the agent's last message for a waiting chat; it now shows the question or permission the chat actually waits on, from acpmux's waitingOn/waitingPrompt.
- A question row shows its prompt with the Decision tag; a permission row shows the Approval tag and "Waiting for you to allow a tool". The last message is never shown.
- A local chat with nothing pending is no longer listed, while a chat acpmux marks
waiting(such as one waiting on a secret) stays listed with the plain waiting line, as does a peer chat that reports no question text. - Adds the
needsYou.waitingPermissionstring for all locales and updates the gallery to cover a remote question and a permission not read here.