Skip to content

fix(chat): preserve async agent display names in traces - #7686

Open
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
investigate/thinking-trace-truncation
Open

fix(chat): preserve async agent display names in traces#7686
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
investigate/thinking-trace-truncation

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • Resolve wait, tail, steer and interrupt labels from async launch display names instead of shortened IDs.
  • Retain only bounded launch identity through chat persistence; keep existing fallbacks and layout unchanged.

Type of Change

  • Bug fix

Testing

  • 183 focused and adjacent tests pass, including save/load compaction, legacy/span traces and fallback behavior.
  • App type-check, lint, 46 audits, docs-manifest and block-registry checks pass.
  • Browser-verified real formatter/activity-row components using synthetic fixtures: before/after, settled/running, wait-any, two-digit counts and narrow overflow. This is component-level verification, not a live model conversation.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • 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 Sep 9, 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 Sep 9, 2026 9:26pm UTC

Request Review

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

Browser verification

Before/after using the real Sim formatter and activity-row components with synthetic launch data. This is an isolated component preview, not a live model conversation.

The full display name replaces the cut-off ID-derived label; IDs and layout are unchanged.

Before and after trace labels

Wait-any wording and two-digit counts are preserved. Narrow panels still use the existing end ellipsis; old traces without launch metadata retain their fallback. Automated tests separately exercise persistence compaction and reload.

Wait-any mode and narrow-panel behavior

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR preserves bounded async-agent launch identity through chat persistence so control-tool traces can display full agent names rather than truncated IDs.

  • Compacts validated launch metadata while continuing to strip other tool output.
  • Resolves wait, tail, steer, and interrupt labels from launch display names within the current message.
  • Retains existing fallbacks for unknown or malformed launch metadata.
  • Adds coverage for live, serialized, reloaded, span-based, legacy, and fallback behavior.

Confidence Score: 5/5

The PR appears safe to merge, with no outstanding actionable findings.

No changes were made after the previous review. The earlier cross-turn concern was manually resolved after BillLeoutsakosvl346 explained that control handles are turn-scoped, rejected across turns, and may reuse IDs, making the message-scoped lookup intentional.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/chat/async-agent-display.ts Introduces bounded validation and compaction of async-agent launch identity.
apps/sim/lib/copilot/chat/persisted-message.ts Retains compact launch identity while stripping other persisted tool-result output.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx Builds a message-scoped launch-name map and uses it when formatting async-agent control tools.
apps/sim/lib/copilot/tools/tool-display.ts Adds optional display-name resolution while preserving humanized-ID fallbacks.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.test.ts Covers live, serialized, persisted, span-based, malformed, and fallback display-name behavior.
apps/sim/lib/copilot/chat/persisted-message.test.ts Verifies that only bounded successful async-launch identity survives persistence compaction.
apps/sim/lib/copilot/tools/tool-display.test.ts Verifies full display names, wait modes, counts, and unknown-ID fallbacks.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Async agent launch result] --> B[Validate and compact identity]
  B --> C[Persist agent ID and display name]
  C --> D[Reload message blocks]
  B --> E[Parse live message blocks]
  D --> F[Build message-scoped name map]
  E --> F
  F --> G[Resolve control-tool title]
  G --> H[Display full agent name]
Loading

Reviews (2): Last reviewed commit: "fix(chat): preserve async agent display ..." | Re-trigger Greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

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

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