Skip to content

[codex] Add conversation activity projection#35

Merged
roackb2 merged 2 commits intomainfrom
codex/conversation-activity-projection
May 2, 2026
Merged

[codex] Add conversation activity projection#35
roackb2 merged 2 commits intomainfrom
codex/conversation-activity-projection

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

Adds the M9 shared conversation activity projection slice:

  • introduces src/core/observability/conversation-activity.ts to project AgentLoopEvent, TraceEvent, and compaction status updates into host-agnostic ConversationActivity records
  • adopts the shared projection in the TUI run-loop adapter and web session subscription hook
  • keeps TUI wording in src/cli/chat/adapters/conversation-activity-adapter.ts instead of leaving the activity renderer in utils/format.ts
  • exports the projection API for programmatic consumers
  • adds focused unit coverage for assistant stream, tools, approvals, memory, compaction, nested trace events, run-finished, and shared tool summaries

Why

This gives future hosts and programmatic users a stable semantic activity layer without depending on React, Ink, SSE payload details, or duplicated trace parsing.

Validation

  • yarn test:unit src/__tests__/unit/core/conversation-activity.test.ts
  • yarn test:unit src/__tests__/unit/tui/chat-activity-format.test.ts
  • yarn vitest run src/__tests__/integration/web/control-plane-sessions-state.test.tsx
  • yarn vitest run src/__tests__/integration/chat/chat-runtime.test.ts
  • yarn eslint
  • yarn typecheck
  • yarn build

@roackb2 roackb2 merged commit f24a114 into main May 2, 2026
4 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: baf5f53933

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

callback();
}
function isAgentLoopEventLike(event: LiveSessionEvent): event is AgentLoopEvent {
return typeof event.type === 'string';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate trace payloads before projecting live activities

isAgentLoopEventLike now accepts any object with a string type, so a network payload like { type: 'trace' } (or a future trace event shape during frontend/backend version skew) is treated as a full AgentLoopEvent and passed to projectTraceEventToConversationActivities, which unconditionally invokes traceProjectors[event.type]. Because session SSE data is parsed from unknown without schema validation in subscribeToChatSessionEvents, this can throw at runtime and break live session updates instead of safely ignoring unsupported events as the previous handler path did.

Useful? React with 👍 / 👎.

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