[codex] Add conversation activity projection#35
Conversation
There was a problem hiding this comment.
💡 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'; |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Adds the M9 shared conversation activity projection slice:
src/core/observability/conversation-activity.tsto projectAgentLoopEvent,TraceEvent, and compaction status updates into host-agnosticConversationActivityrecordssrc/cli/chat/adapters/conversation-activity-adapter.tsinstead of leaving the activity renderer inutils/format.tsWhy
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.tsyarn test:unit src/__tests__/unit/tui/chat-activity-format.test.tsyarn vitest run src/__tests__/integration/web/control-plane-sessions-state.test.tsxyarn vitest run src/__tests__/integration/chat/chat-runtime.test.tsyarn eslintyarn typecheckyarn build