Skip to content

(CODUX-224) Build cinematic invocation feedback projection - #3053

Merged
numnx merged 1 commit into
feature/CODUX-224-repair-3d-agent-activity-feedbackfrom
task/feature-codux-22-t01-codex-a328b9ba-mrjqd8cs
Jul 13, 2026
Merged

(CODUX-224) Build cinematic invocation feedback projection#3053
numnx merged 1 commit into
feature/CODUX-224-repair-3d-agent-activity-feedbackfrom
task/feature-codux-22-t01-codex-a328b9ba-mrjqd8cs

Conversation

@numnx

@numnx numnx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Build cinematic invocation feedback projection

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 224 · Repair 3D agent activity feedback · Task: T01

Repair the existing 3D Chat stage so matching active Project Manager invocations drive cycling avatar tools and a transient animated bubble showing the latest eligible invocation assistant message, in-progress status, and unique tool count; improve large-screen response sizing, typography, and thought-to-avatar spacing; and cover lifecycle, reduced-motion, responsive, stale-response, and fetch-failure behavior with dashboard tests and synchronized documentation.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.6-sol

⏱️ Timing

Started 2026-07-13 21:24:36 UTC
Finished 2026-07-13 21:38:08 UTC
Duration 13m 32s

📊 Token Usage

Metric Value
Input tokens 143,715
Cached input tokens 4,368,896
Output tokens 21,704
Total tokens 4,534,315
Invocations 1
Tool calls 49
Active time 12m 54s

Included usage estimate (subscription/local login): $3.55

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Create a typed cinematic feedback model and hook that select the current Project Manager reply invocation, load its persisted transcript through the existing API, and expose safe interim assistant copy plus an accurate unique-tool count.

## Scope
- Create `dashboard/src/v2/lib/cinematic-invocation-feedback.ts`
- Create `dashboard/src/v2/hooks/use-cinematic-invocation-feedback.ts`
- Reuse `dashboard/src/v2/lib/invocation-api.ts` and its `fetchInvocationMessages` contract without changing backend routes or schemas
- Create `tests/dashboard/v2/cinematic-invocation-feedback.test.ts`
- Create `tests/dashboard/v2/use-cinematic-invocation-feedback.test.tsx`

## Implementation Requirements
1. Export a typed selector that chooses the latest running `dashboard_reply` or `worker_reply` invocation whose `agentPresetId` matches the Project Manager preset, using `startedAt` and `id` for deterministic ordering; return no foreground feedback for unrelated or terminal invocations.
2. Project the invocation transcript into the latest non-empty assistant prose message, excluding reasoning, injected-context, tool-call, tool-result, user, and system turns from the displayed prose.
3. Count unique tool calls from normalized invocation metadata, deduplicating by `toolCallId` and using the message id only when no call id exists so paired results and repeated refreshes do not inflate the count.
4. Implement `useCinematicInvocationFeedback` so it fetches through `fetchInvocationMessages` when the active invocation id or its `messageCount`, `lastMessageAt`, or `updatedAt` changes, preserves same-invocation content during refresh, and exposes typed active-invocation, message, tool-count, loading, and non-fatal error state for `CinematicStage`.
5. Guard asynchronous updates with abort or generation tracking, discard stale responses after invocation/project changes, clear feedback when the invocation becomes terminal or disappears, and perform complete unmount cleanup.
6. Add deterministic tests for selection precedence, empty transcripts, eligible and ineligible message kinds, unique tool counting, refresh updates, request failure, stale out-of-order responses, terminal cleanup, and unmount cleanup.

## Constraints
- Do not add or modify server endpoints, persistence schemas, shared invocation contracts, or provider parsers; the existing invocation summary and message records are sufficient.
- Do not couple cinematic feedback to whichever invocation is selected in the Invocations pane.
- Do not log or render raw prompts, system messages, reasoning, arguments, tool output, or other internal transcript content as agent prose.
- Preserve the existing rule that unrelated project work remains background activity and cannot activate the Project Manager.
- A transcript fetch failure must not replace the normal chat transcript or promote the whole Chat page into an error state.

## Verification
- Run `pnpm exec vitest run tests/dashboard/v2/cinematic-invocation-feedback.test.ts tests/dashboard/v2/use-cinematic-invocation-feedback.test.tsx`.
- Run `pnpm run typecheck:dashboard`.
- Confirm a matching running reply invocation refreshes its interim message and deduplicated tool count, while unrelated, terminal, stale, and failed fetches never surface incorrect feedback.
🌿 Branch Info

Base: feature/CODUX-224-repair-3d-agent-activity-feedback
Head: task/feature-codux-22-t01-codex-a328b9ba-mrjqd8cs


🤖 Generated by Code UX

@numnx
numnx merged commit a4e69c6 into feature/CODUX-224-repair-3d-agent-activity-feedback Jul 13, 2026
20 checks passed
@numnx
numnx deleted the task/feature-codux-22-t01-codex-a328b9ba-mrjqd8cs branch July 13, 2026 21:42
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