Skip to content

feat(web,mobile): group nested tool calls under their parent - #12

Draft
jhomra21 wants to merge 7 commits into
feat/provider-droid-nextfrom
feat/grouped-nested-tools
Draft

jhomra21 wants to merge 7 commits into
feat/provider-droid-nextfrom
feat/grouped-nested-tools

Conversation

@jhomra21

@jhomra21 jhomra21 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Droid in Script mode runs several tools inside one Script call. T3 shows the Script and each of its steps as separate top-level rows, so you can't tell which commands and edits belonged to which Script.

This groups nested tool calls under their parent tool. A tool item whose parentItemId points to another tool item in the same thread and turn becomes a child row. The parent shows as one collapsible row, and each child keeps its normal row, with output, diff, approval and status. The Droid adapter in #3 sets parentItemId for Script steps. Any provider that sets it gets the same grouping.

  • One shared function, groupNestedToolItems in packages/client-runtime/src/work-log/nestedTools.ts, builds the tree for web and mobile.
  • An item whose parent is missing, isn't a tool, or is in another thread or turn stays at the top level. Cycles are broken. No item is dropped or hidden.
  • A running child keeps its group shown as running.
  • Expanded children render through the existing bounded work-group lists on web and mobile, so a Script with hundreds of steps stays virtualized.
  • On mobile, unchanged groups keep their identity across updates, so the activity caches still apply.

Stacked on #3.

Before and after

Web, the same Droid turn: one Script that ran three commands and created a file.

Before (flat) After (collapsed) After (expanded)
Before: the Script and its four steps listed as separate rows After: the Script shown as one collapsed row After: the Script expanded with its four steps nested under it

Narrow width:

Before After (expanded)
Before at narrow width After at narrow width

Mobile has the same change but no captures yet.

Testing

  • nestedTools.test.ts: nesting, ordering, missing, foreign and non-tool parents, cycles, concurrent Scripts, interleaved top-level items, and child-thread tools.
  • MessagesTimeline.logic.test.ts and threadActivity.test.ts: grouping in each client, plus mobile identity reuse.
  • MessagesTimeline.browser.test.tsx: 1,002 children stay virtualized and scroll correctly.
  • client-runtime, web and mobile typechecks, lint, format and knip pass.

Implemented with GPT-6.1 Sol through Factory Droid.

jhomra21 and others added 7 commits October 31, 2026 15:56
Nested provider tool calls were rendered as unrelated top-level work on web and mobile, obscuring their outer execution.

Derive same-turn tool ancestry once in client-runtime, reject cycles and invalid parents, and preserve ordered child rows under each outer tool. Reuse existing disclosures and detail renderers, propagate live child status, preserve request access and search reveal, and invalidate mobile cached prefixes when late ancestry can change them.

Implemented with GPT-6.1 Sol through Factory Droid.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Reuse unchanged mobile parent activities and safe feed prefixes while invalidating affected ancestry. Render expanded children through the existing bounded lists with stable disclosure and scroll state.

Allow explicit same-thread parent links for runless tools so Droid child-thread Scripts group without weakening thread or turn isolation. Cover identity, cache boundaries, virtualization, restoration, and runless scope.

Implemented with GPT-6.1 Sol through Factory Droid.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

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