Skip to content

fix(mothership): hold a tool call's display grouping beside its arguments - #9296

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/activity-grouping-persist
Oct 22, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/activity-grouping-persist

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Hold a tool call's display grouping (activity) in its own field beside its arguments, end to end, instead of merging it into params.activity. The two shared one key, so an integration operation with its own activity argument lost the gateway's grouping on reload, and a completed grouping could overwrite an operation-owned activity argument with the same id
  • Server stream handler: params stay exactly as the frame gave them; the grouping (own or inherited, titles completed) lives on ToolCallState.activity
  • Persisted history: PersistedToolCall.activity is written and normalized; the display projection, Stop reconcile and stop-path replay (buildLiveAssistantMessage) carry it, and the browser model serializes and replays it the same way
  • One rule, readFrameActivity, decides what grouping a call frame supplies for all three frame reducers (server, browser, stop-path replay): a gateway's resolved operation owns its arguments, so its frames, including repeats after the rebind, never supply one
  • Readers use readCallActivity (the field, else params.activity), so older rows render unchanged
  • Known limit: on reload, a resolved operation with no inherited grouping whose own activity argument is grouping-shaped (an object with a string id) still reads as a grouping, since it can't be told apart from an older row. Pre-existing; built-in integrations take activity as a string

Type of Change

  • Bug fix

Testing

  • New regression cases at each owner boundary, each shown red on the prior code or with its guard reverted: persisted-message.test.ts (write → JSON → normalize → display), handlers.test.ts (execution args and held grouping, incl. a repeated frame), effective-transcript.test.ts (stop-path replay), turn-model-serialize.test.ts (live model and snapshot replay)
  • Touched and sibling suites pass locally (193 tests); biome on changed files. Type-check, check:audits, the full suite and the integration suite run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 22, 2026 12:12am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 19 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found in the changes since the previous review.

Summary

Keeps tool-call display grouping in activity, beside the operation’s unchanged params, across streaming, saving, reload, and Stop.

  • Tool calls keep display groupings separate from their operation arguments.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Frame[Tool call frame] --> Reducer[Read display grouping]
  Reducer --> Args[Unchanged params]
  Reducer --> Activity[Separate activity field]
  Args --> Saved[Saved tool call]
  Activity --> Saved
  Saved --> Normalize[normalizeMessage]
  Normalize --> Display[Chat display]
Loading

Reviews (2) · Last reviewed commit: "fix(mothership): keep the protocol schem..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 19 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 6381473 into staging Oct 22, 2026
44 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/activity-grouping-persist branch October 22, 2026 00:20

This branch was previously deployed

1 inactive deployment
Preview — 384ca41f Deployed Oct 22, 2026 by vercel[bot]
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