Skip to content

#901 Name the asking subagent and page requests in permission and question panels - #910

Merged
ivanfenenko merged 2 commits into
mainfrom
feature/901-subagent-requests-in-panels
Oct 31, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
feature/901-subagent-requests-in-panels

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #901 (part of #899)

What

Both panels still replace the composer while a request waits.

  • Who's asking: a permission or question from a descendant subagent session shows a light amber row above the panel. It has the agent letter, "general · subagent wants to run: npm test" or "explore · subagent asks", and Open, which opens that subagent's session. Requests from the current session show no row.
    • The name comes from the sessions Session Chat already loads to place descendant requests: v2 sessions carry an agent field (now mapped into the domain Session), and v1 falls back to the task tool's (@agent subagent) title suffix.
  • Paging: ‹ › arrows next to "1 of N", page dots under the panel, and a horizontal swipe on the panel. The selected request is tracked by id, so new or answered requests don't move the panel. Each question request keeps its own answers while you page away and back.
  • Question collapse: the question panel gets the same chevron as the permission panel and collapses to an "↑ Answer question" pill (OpenCodeActionPill, the current collapsed-pill component). Neither pill has a ✕.
  • Component Gallery: "Subagent" and "Q Subagent" composer scenarios on both platforms; the new pill variant shows up in the Action Pill gallery automatically.
  • Scenario harness: permission-in-parallel-subagents (the session's own rm -rf dist plus general and explore subagents asking at once) and question-in-parallel-subagents. Built-in subagents deny the question tool, so the harness config now allows it for general and explore.

No protocol-specific UI. Attribution, paging and collapse live in the inbox region state and Screen Model on both platforms.

Checks

  • iOS unit tests: InboxRequestAttributionTests, SessionChatViewModelTests, QuestionRequestSupportTests: 242 tests passed.
  • Android JVM tests: InboxRequestAttributionTest, SessionChatViewModelTest, QuestionRequestSupportTest, SessionDomainAdapterTest: 274 tests, 0 failures.
  • New tests cover attribution (own session vs subagent, v2 agent field, v1 title suffix, nested subagents, fallback) and paging (clamping, page by id, per-request answers, hide/show of both panels).
  • Harness check.mjs on v2: both new scenarios and question-answer-in-app finish.
  • Real apps against the scenario harness (v2), screenshots in a comment below: paging by arrow and swipe, subagent rows, Open going to the subagent session, the "Answer question" pill and expanding it again, answering both questions on iOS.

Risks / Follow-ups

  • v1 not checked in the real apps. There is no 1.x opencode binary on the test machine. v1 attribution relies on the task title suffix, which is covered by unit tests only, and the harness's v1 config change is untested.
  • Android question paging was checked through unit tests; the emulator run covered the question panel, its subagent row, and the collapse/expand. Arrow and swipe paging were checked on the permission panel.
  • Pager arrows use the existing arrowBack/arrowForward icons, so the generated icon catalog stays untouched while Session Chat: floating pill component #900 is in flight. Session Chat: connect needs-input pill and prompt pills #906 moves both pills onto the new pill component.
  • "Tapping the needs-input pill pages to that request" (Session Chat: floating pill system #899) belongs to the background work pill and is not in this PR.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@ivanfenenko

ivanfenenko commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Real apps against the scenario harness (opencode v2, scripted model): permission-in-parallel-subagents and question-in-parallel-subagents.

Step iOS Android
Session's own permission, 1 of 3, no subagent row ios own android own
Swipe → "general · subagent wants to run: npm test" ios general android general
Swipe → "explore · subagent wants to run: npm run lint" ios explore android explore
Open → the explore subagent's session ios open android open
Question from a subagent, 1 of 2 ios question android question
Next → the other subagent's question (the first answer is kept when paging back) ios second —
Collapsed to "Answer question", no ✕ (tapping it expands the panel again) ios pill android pill

Not captured: v1 (no 1.x server binary available here), and Android question paging by arrow or swipe (covered by unit tests).

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

Automated review: no finding that 2+ of 1 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.152 · 2 pass(es) failed

@ivanfenenko ivanfenenko left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review of #901 (attribution, paging, question collapse).

Checked and found OK:

  • v2 agent matches the server: Session.agent is Agent.ID.pipe(optional) in opencode's v2 session schema. Both DTOs decode it as optional (iOS uses try?, Kotlin has a nullable default), and it is mapped into the domain Session in the adapter, so feature code never touches the wire type.
  • The v1 suffix parse matches the task tool's title, params.description + " (@${agent.name} subagent)". The server writes that text in English and never localises it. A user rename drops the suffix, and the row then falls back to "subagent …" with no name. That is acceptable.
  • Nested subagents resolve to the asking (grandchild) session. Paging by id works, the page clamps at the ends, and a gone selection falls back to the first request. Answers are guarded by the visible request id, and per-request answers are restored on both platforms.
  • Harness changes are test-only. I found no private data in the code, fixtures or the evidence comment.
  • Tests: Android InboxRequestAttributionTest, SessionChatViewModelTest, QuestionRequestSupportTest, SessionDomainAdapterTest gave 274 tests, 0 failures. iOS InboxRequestAttributionTests, SessionChatViewModelTests, QuestionRequestSupportTests: TEST SUCCEEDED.

Findings are inline: 2 should-fix, 1 nit. One more nit that has no line to anchor to: the branch carries e0686179 Attach PR evidence with gh instead of evidence branches, a second copy of #896 (ddf36da0), which is already on main. Because of it, AGENTS.md, two skills and the scripts/publish-evidence.sh deletion show up under Files changed. The net diff against main for those files is empty, so a rebase onto main would drop it and leave a clean diff.

ivanfenenko and others added 2 commits October 31, 2026 18:09
…stion panels

- A permission or question from a descendant subagent session shows a light
  amber row with the agent letter, "general · subagent wants to run: npm test"
  or "explore · subagent asks", and Open to show that subagent's session. The
  name comes from the v2 session `agent` field, or the v1 task title suffix.
- Arrows beside "1 of N", dots under the panel and a horizontal swipe page
  between waiting requests; each question request keeps its own answers.
- The question panel collapses to an "Answer question" pill like the
  permission panel; neither pill can dismiss the request.
- Harness: two P1 scenarios with parallel subagent permissions and questions,
  and the harness config lets general/explore subagents ask questions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ers pure

- The Review permission / Answer question pill shows whenever a request is
  hidden, so a question collapsed in a subagent session can be reopened.
- Kept question answers and their owner live in the inbox state; the draft
  sync is a pure function, so a re-run StateFlow update cannot mix answers.
- TalkBack skips the attribution letter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko force-pushed the feature/901-subagent-requests-in-panels branch from 53ee690 to d8268fe Compare October 31, 2026 17:14
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Android recheck for the child-session fix (scenario harness v2, question-in-parallel-subagents, Open into the general subagent's session):

Collapsed in a subagent session: the pill shows over the child lockout Tapping it reopens the question
pill reopened

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Rebased on main to drop the duplicate copy of #896 (e068617); Files changed now shows only this PR. Android JVM tests: 280 passed, 0 failures (attribution, Session Chat view model, question support, session adapter, and the new HiddenRequestPillTest and SyncedQuestionDraftsTest). iOS code is unchanged since the last run (242 passed).

@ivanfenenko
ivanfenenko merged commit feadc1f into main Oct 31, 2026
@ivanfenenko
ivanfenenko deleted the feature/901-subagent-requests-in-panels branch October 31, 2026 20:52
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.

Session Chat: name the asking subagent and page requests in permission and question panels

1 participant