Skip to content

SMOODEV-2717: Carry structured tool details on AgentEvent::ToolCallComplete (held) - #101

Open
brentrager wants to merge 1 commit into
mainfrom
SMOODEV-2717-toolresult-details
Open

SMOODEV-2717: Carry structured tool details on AgentEvent::ToolCallComplete (held)#101
brentrager wants to merge 1 commit into
mainfrom
SMOODEV-2717-toolresult-details

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Held for Brent's release — pairs with the llm_metadata seam (#100)

Ride this on the same core release as #100 so the full SMOODEV-2717 "interactive analyst answers → real artifact cards" version can turn on immediately after, with no second release cycle.

What & why

AgentEvent::ToolCallComplete carries result — the tool's LLM-facing text, truncated to 500 chars (result.content.chars().take(500)). The structured ToolResult.details (the UI-facing payload: trace ids, error counts, table rows that the observability tools already attach) is dropped. So a downstream SEP server can only re-emit truncated prose — it can't render real artifact cards.

This adds an optional details: Option<serde_json::Value> to the event, populated un-truncated from ToolResult.details at both send sites.

#[serde(default, skip_serializing_if = "Option::is_none")]
details: Option<serde_json::Value>,

default + skip_serializing_if keeps the wire byte-identical when absent, so older runners/clients are unaffected.

Tests

  • tool_call_complete_details_omitted_when_noneNone serializes no details key (proves wire-identical to pre-change).
  • tool_call_complete_details_forwarded_verbatim_when_someSome(v) round-trips verbatim.
  • cargo test (agent suite), cargo fmt --check, cargo clippy all clean (the 2 clippy warnings are pre-existing in checkpoint.rs, untouched here).

After this publishes (follow-ups, NOT in this PR)

  1. smooth-operator repo — the server runner's ToolCallComplete arm threads details into the stream_chunk state as state.rawResponse.toolResult.data (3 lines; can't compile until this core version publishes — the workspace pins smooai-smooth-operator-core = "0.16.2").
  2. smooai monorepo — the SMOODEV-2717 web renderer (already shipped, prose-linkify version) upgrades to render artifact cards from event.data.state.rawResponse.toolResult.data.
  3. Populate ToolResult.details in the copilot's tool provider where a tool returns structured data but doesn't yet attach it, and Go/TS/dotnet/Python engine parity (additive + back-compat, so cross-engine wire stays compatible).

🤖 Generated with Claude Code

https://claude.ai/code/session_018tRq2Rge3gGHCjJdNx6xDD

…mplete

The event only carries `result` — the tool's LLM-facing text, truncated to
500 chars. The structured `ToolResult.details` (the UI-facing payload:
trace ids, counts, table rows) is dropped, so a downstream SEP server can
only re-emit truncated prose and can't render real artifact cards.

Add an optional `details: Option<serde_json::Value>` to the event, populated
un-truncated from `ToolResult.details` at both send sites. `#[serde(default,
skip_serializing_if = "Option::is_none")]` keeps the wire byte-identical when
absent, so older runners/clients are unaffected.

Held for a core release (no changeset/publish), pairs with:
- the smooth-operator server runner forwarding it into `stream_chunk` state
  (`state.rawResponse.toolResult.data`), and
- the SMOODEV-2717 web renderer (smooai monorepo), which upgrades from
  linkifying the answer prose to rendering artifact cards from that data.

Rust-only for now; Go/TS/dotnet/Python engine parity is a follow-up (the
field is additive and back-compat, so cross-engine wire stays compatible).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tRq2Rge3gGHCjJdNx6xDD
@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 97aff1f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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