Skip to content

Code-run card: live execution feed from code_mode:* events #376

Open

Description

@omridevk

Problem

While `execute_typescript` runs, the user sees nothing until the sandbox returns. The upstream `@tanstack/ai-code-mode` sandbox emits progress events over the AG-UI custom-event channel — `code_mode:execution_started`, `code_mode:console`, `code_mode:external_call` / `external_result` / `external_error` — but conciv drops them all: `codeModeToolChunks` (`packages/core/src/chat/code-mode-parts.ts`) maps only our own `conciv:tool_call/result/error` events into synthetic tool parts and returns `null` for everything else (pinned by `packages/core/test/chat/code-mode-parts.test.ts:63`). Nothing in the repo subscribes via `onCustomEvent`.

The inner tool calls already surface properly as first-class transcript parts with cards and captures (#344) — this issue is ONLY about the live progress feed (console lines, external-call timeline, started marker) inside the code-run card while execution is in flight.

Shape

  • Map selected `code_mode:*` events into UI-only state keyed by the parent `execute_typescript` toolCallId (`parentToolCallId` already rides on the synthetic parts' metadata).
  • Render the feed inside core's code-run card (`packages/core/src/cards.tsx` since Tool cards: render the element page/extension tools acted on, not raw JSON #344 slice 2E) — console lines with level styling, external calls with durations, a running indicator until the result part lands.
  • Ephemeral by design: the feed is progress UI, not transcript content — it must NOT become message parts or model context, and it need not survive reload (the final result part already does).
  • Colocation rule applies: the card ships from core; any event-mapping vocabulary that names no tool belongs in ui-kit-chat.

References

TanStack AI doc "Showing Code Mode in the UI" (code-mode-client-integration) describes the raw event contract and an onCustomEvent consumer for React.

Activity

  1. added
    enhancement
    on Aug 9, 2026
  2. omridevk commented on Aug 10, 2026

    @omridevk
    ContributorAuthor

    Pulled under the tool-card kit epic #381 as a sub-issue, because #396 changes its weight. Once code mode is the only chat tool surface, every turn runs through execute_typescript and the code-run card is the card the user watches for the whole turn — the missing code_mode:* feed stops being a nicety and becomes the difference between a visible turn and a frozen one. Blocked by #396.

  3. omridevk commented on Aug 11, 2026

    @omridevk
    ContributorAuthor

    Heads-up from the #413/#428 work (aggregated page-session card): the new fold policy absorbs page-driving execute_typescript runs into one session card per driving stretch in the thread. When this issue's live code_mode:* feed lands, its render target for page-driving runs is the session card (SessionCard in @conciv/extension-page), not a standalone code-run card; non-page code runs keep the core code-run card. The synthetic-parts channel this issue references is unchanged — the session card's step rows already stream from those parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions