feat(app-server): render live Spine agent trees in Codex App - #2
Open
kabxx wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in, live-only Spine task-tree visualization for Codex App by introducing an internal MCP App resource (ui://spine/tree.html) and app-server-side transient state/routing to keep the rendered tree current during a running turn without persisting it into thread history or model context.
Changes:
- Introduces a new internal Spine UI module in app-server that accumulates Spine tree + spawn progress + nested agent subtrees, emits live
item/started+item/completednotifications, and exposes the UI via an internal MCP server/tool/resource whenCODEX_SPINE_APP_UIis enabled. - Adds robust routing/synchronization logic for nested agents (generation-aware forwarding, terminal acknowledgements, timeout barrier, and invalidation on rollback/listener lifecycle changes).
- Updates TUI rendering/filters to hide the internal Spine UI carrier items and internal MCP inventory entries, while keeping ordinary MCP tool calls visible; adds snapshot/test coverage and improves spawn progress “Running” reporting in core.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| codex-rs/tui/src/snapshots/codex_tui__multi_agents__tests__activity_preview_filters_internal_spine_ui_item.snap | Adds snapshot coverage ensuring internal Spine UI items are filtered from activity preview. |
| codex-rs/tui/src/multi_agents.rs | Hides internal Spine UI items from multi-agent activity summaries. |
| codex-rs/tui/src/lib.rs | Registers the new internal_spine_ui module. |
| codex-rs/tui/src/internal_spine_ui.rs | Implements exact-match detection for internal Spine UI items and server-status fingerprinting. |
| codex-rs/tui/src/history_cell/tests.rs | Extends MCP inventory tests to include internal Spine UI server status input (and validate filtering). |
| codex-rs/tui/src/history_cell/mcp.rs | Filters the internal Spine UI server from /mcp inventory output in the TUI. |
| codex-rs/tui/src/chatwidget/tool_lifecycle.rs | Drops internal Spine UI tool-call lifecycle items from live transcript rendering. |
| codex-rs/tui/src/chatwidget/tests/app_server.rs | Adds test ensuring live internal Spine UI items are not rendered into the transcript. |
| codex-rs/core/tests/suite/spine_spawn.rs | Adds integration coverage for spawn progress reporting Running even when children emit no Spine nodes. |
| codex-rs/core/src/spine/spawn.rs | Improves spawn progress emission by watching child status transitions and emitting progress updates accordingly. |
| codex-rs/core/src/spine/spawn_tests.rs | Adds focused unit tests for the terminal-status watch behavior. |
| codex-rs/core/src/session/mod.rs | Adjusts spawn progress delivery to be non-persistent and lightweight to emit. |
| codex-rs/app-server/tests/suite/v2/spine_ui_live.rs | Adds end-to-end v2 tests asserting Spine UI items are live-only and not restored after cold resume (while Core tree can be rebuilt). |
| codex-rs/app-server/tests/suite/v2/mod.rs | Wires the new Spine UI live test module into the suite. |
| codex-rs/app-server/tests/suite/v2/mcp_tool.rs | Adds tests for internal Spine tool-call behavior, collision behavior, and soft-off disabling. |
| codex-rs/app-server/tests/suite/v2/mcp_server_status.rs | Updates MCP server status tests to account for internal Spine server injection and pagination behavior. |
| codex-rs/app-server/tests/suite/v2/mcp_resource.rs | Adds resource-read collision tests ensuring internal resource wins only when enabled. |
| codex-rs/app-server/src/thread_state.rs | Introduces Spine UI runtime wiring into per-thread state and listener lifecycle cleanup/invalidation paths. |
| codex-rs/app-server/src/thread_state_spine_ui.rs | Implements per-thread Spine UI accumulation, revisions, terminal tracking, and carry-forward behavior. |
| codex-rs/app-server/src/thread_state_spine_ui_tests.rs | Adds comprehensive tests for Spine UI thread/runtime behavior, routing, coalescing, and race handling. |
| codex-rs/app-server/src/thread_state_spine_ui_manager.rs | Implements the manager-level routing, queuing, terminal barrier, and invalidation orchestration for child/parent Spine UI state. |
| codex-rs/app-server/src/spine_ui/tree.html | Adds the self-contained MCP App HTML UI for rendering the Spine tree, agents, disclosure behavior, and intrinsic height reporting. |
| codex-rs/app-server/src/spine_ui/render.rs | Defines the compact structured-content render payload for the UI (snapshot + spawn calls + agent subtrees). |
| codex-rs/app-server/src/spine_ui/mcp.rs | Implements enablement parsing, internal MCP server/tool/resource plumbing, and live-only item carrier creation. |
| codex-rs/app-server/src/spine_ui.rs | Adds core Spine UI state model, revisioning, filtering, and snapshot/spawn reconciliation logic. |
| codex-rs/app-server/src/spine_ui_tests.rs | Adds unit tests for activation rules, payload privacy/shape, stable IDs, parent filtering, and sync-timeout semantics. |
| codex-rs/app-server/src/request_processors/thread_lifecycle.rs | Integrates Spine UI routing/barrier behavior into listener task lifecycle and command handling. |
| codex-rs/app-server/src/request_processors/mcp_processor.rs | Injects the internal Spine MCP server/status/resource/tool-call handling when enabled. |
| codex-rs/app-server/src/outgoing_message.rs | Exposes subscribed connection IDs needed to target late terminal refresh notifications correctly. |
| codex-rs/app-server/src/message_processor.rs | Passes ThreadStateManager into MCP request processing to serve internal Spine tool calls. |
| codex-rs/app-server/src/lib.rs | Registers the new spine_ui module. |
| codex-rs/app-server/src/bespoke_event_handling.rs | Emits Spine UI live item notifications on SpineTreeUpdate/SpineSpawnProgress and completes the item on turn completion/interruption. |
| codex-rs/app-server/BUILD.bazel | Adds tree.html as compile_data to satisfy Bazel build-time file access for include_str!. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <meta charset="utf-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <meta name="color-scheme" content="light dark"> | ||
| <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data:"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a strict opt-in, read-only live Spine task-tree view for Codex App.
Implementation
ui://spine/tree.htmlMCP App resource with compact, validated payloads.Runningprogress for agents that do not create Spine nodes./mcpinventory while preserving ordinary MCP items.Behavior
CODEX_SPINE_APP_UI=1,true, oron.Validation
git diff --checkpassed with 8 jobs.mainbaseline and is outside this change.Known limitation
Each new card contains the complete accumulated tree, so keeping many cards open can increase frontend memory and network usage with session length. The cards add no rollout or on-disk growth.