🤖 feat: make Project Chat the orchestration control plane - #3808
🤖 feat: make Project Chat the orchestration control plane#3808ammar-agent wants to merge 65 commits into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
@codex review Please review the parent/child progress interaction semantics, especially typed wait interruption propagation and per-child response classification. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b61309bf38
ℹ️ 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".
|
@codex review Addressed the per-child scoping issue: text only counts when exactly one child is pending, while multi-child turns require successful same-child guidance. Added a mixed text + guidance regression test. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4dbec6a5f
ℹ️ 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".
|
@codex review Addressed all three findings:
Added targeted regression coverage for each case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef2c7d8b79
ℹ️ 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".
|
@codex review Addressed both findings:
Added component coverage and re-verified the full-app phone and desktop stories. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Rebased onto the latest |
3766bfb to
fa658da
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa658da627
ℹ️ 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".
|
@codex review Addressed the completion race: a queued progress update that already released a foreground wait is now claimed and preserved until the parent receives it, while unclaimed stale updates are still removed. Added regressions across queue, direct enqueue, prequeued waiter registration, and terminal cleanup. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0241b79bb9
ℹ️ 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".
|
@codex review Addressed the ordering race by replacing a claimed queued progress entry in place with the completed report envelope. This preserves the interaction boundary without producing completed → stale in-progress context. Added queue and TaskService regressions. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 084ce9da17
ℹ️ 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".
|
@codex review Addressed the crash-recovery gap: terminal queue replacement now has a persisted |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a899d2d5ab
ℹ️ 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".
|
@codex review Addressed the artifact durability gap: recovery is now armed only after the parent-owned report artifact is read back and verified. Failed artifact persistence falls back to the durable history + already-injected wake path. Added a deterministic failed-artifact regression. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bacd42659
ℹ️ 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".
|
@codex review Addressed the scope durability gap: queue recovery is now armed only after both the report payload and the parent session’s scope-visible artifact index are verified. An index write/read failure falls back to durable history delivery. Added deterministic payload- and index-failure regressions. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d52d803773
ℹ️ 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".
00dcb17 to
d2dafc5
Compare
|
@codex review Replaced the queue-recovery stack with a simpler authoritative handoff: the interrupted |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2dafc5e68
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d97c9f760e
ℹ️ 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".
Keep the exact logical Project Chat target config separate from the parent-owned storage and trust config so omitted runtime settings match manual workspace creation for root and child selections.
Inspect runtime deletion Results during project-scope revalidation rollback, log failed cleanup locations, and return actionable manual cleanup errors without persisting invalid workspace metadata.
|
Addressed both current-head Codex findings in the latest commits:
Validation passed: full TaskService (377) and WorkspaceService (318) suites, |
|
@codex review Both latest P2 findings are addressed on current head |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Materialize child attach_file outputs into owner-session storage, expose durable descriptors through task results, and show compact UI availability summaries.
Introduce versioned execution handles, owner-scoped persistence, and read-only adapters for workspace-turn and legacy agent-task records.\n\n---\n\n_Generated with • Model: • Thinking: _\n\n<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=high -->
Wire canonical execution persistence into task launch and migrate list/send/terminate scope resolution through the execution registry while retaining legacy workspace aliases.
Make new task executions return created handles immediately while preserving legacy completed-result parsing for historical transcripts.\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `high` • Cost: `.09`_\n\n<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=high costs=3.09 -->
Add registry-owned snapshots, active upserts, terminal settlement, and abortable/timeout waits with alias resolution and restart-durable results.
Route task_await canonical agent IDs and aliases through ExecutionRegistry snapshots and terminal waits while preserving legacy artifact fallback and foreground wait behavior.
Route current task executions through explicit workspace targets, retain only the narrow legacy transcript fallback, and cover canonical task/task_await navigation plus phone overflow behavior. _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `high` • Cost: `$32.81`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=high costs=32.81 -->
Return canonical execution IDs for new workspace turns and resolve await, list, terminate, lifecycle, attention, and progress operations through the execution registry while retaining wst shadow aliases for compatibility.
Persist transcript-only workspace metadata, add the idempotent WorkspaceService retirement API, and reject new messages for retired workspaces. Preserve config, session, and history while using existing archive safeguards before runtime cleanup.
Route completed canonical cleanup through bounded transcript retirement while preserving legacy removal behavior and retained transcript nodes.
Use the repository-preferred interface declaration for the focused cleanup test harness.
Centralize canonical versus legacy task workspace classification, restrict legacy sidebar branches, and allow archived transcript-only execution targets to open.
Route opaque workflow task IDs through the scoped execution wait API while preserving legacy report waits. Canonical timeouts avoid report reprompts and resolve target workspaces before hard-timeout termination.
Keep AbortSignal.reason behind an unknown boundary before rethrowing canonical wait interruptions.
Add canonical and legacy agent execution graph listing, active filtering, depth, descendant queries, and canonical-aware legacy parent adaptation.\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `high` • Cost: `$1.23`_\n\n<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=high costs=1.23 -->
Summary
Turn each project into a persistent control plane. Selecting a project now opens Project Chat, a workspace-quality chat backed by a hidden project session and a fixed, coordination-only Orchestrator. The Orchestrator creates and follows up in ordinary project workspaces, keeps running work in the background so the user can continue chatting, and explicitly manages workspace archive/removal lifecycle. Individual workspace chats remain available as drill-down views.
This also retains and extends the original sub-agent progress work in this PR: foreground task waits now hand incremental child reports to the parent as real interactions instead of encouraging another automatic wait.
Background
The old project page was primarily a New Workspace form. That made workspace creation the product's top-level action and pulled users into individual execution chats for every task. A parent that compiles, tests, or blocks on child output also stops being available as a coordinator.
Project Chat reverses that hierarchy: users talk to the project, and workspaces become durable execution units that appear in the sidebar for optional detail. The project parent delegates implementation, remains responsive to new input, and owns how long its workspaces persist.
Prior first-class Orchestrator and Chat-with-Mux implementations were evaluated as prior art. This implementation deliberately avoids a hidden
WorkspaceConfigentry: historical hidden workspaces leaked into workspace-wide background jobs and downgrade behavior. Project Chat has a separate persisted session identity and storage root instead.Implementation
Persistent project chat
ProjectConfig.projectChatcontract with a backend-generatedproject-session_*ID.~/.mux/project-sessions/<session-id>while ordinary workspace sessions remain under~/.mux/sessions.projects.chat.getOrCreate; the renderer consumes backend-returned virtual metadata and never synthesizes identity.workspace.list,workspace.getInfo, sidebar workspace counts, archive lists, project-removal blockers, and generic workspace lifecycle APIs.Fixed Orchestrator and continuous availability
Project workspace orchestration
project_workspace_listtool for canonical active/archived workspace IDs and latest turn state, plus a responsive transcript card with workspace drill-down.Project-centric UI
aria-currentstate. Untrusted projects stop at an inline trust gate before the project session is created.+action andCtrl/Cmd+N.Interactive sub-agent progress
task_send_message, with an exception for explicitly requested routine periodic reports.Validation
make static-check-full(including lockfile-free packed-CLI installation and docs link checking)nulloptional input while preserving the documentedinclude_archived: truedefaultrun_in_background: nullwhile preserving the non-blocking defaultrun_in_background: nullpreserves the foreground defaultlocalfallback, parent projectworktreeprecedence over global/sub-projectlocal, and explicit rejection of unsupported remote/container defaultsorigin/main(82/79 files and 348/305 estimated snapshots); the new isolated tool-card story is explicitly Pixel-disabled and does not add enabled snapshots.Risks
The highest-risk areas are virtual-session routing and durable ownership/recovery. Project Chat storage and behavior are selected only when verified project metadata owns the ID (with a scoped retained route during cleanup); load-time repair reserves every explicit, basename-backed, or generated legacy workspace identity, and the last verified Project Chat route survives transient unreadable/malformed config so active writes never jump roots. Cleanup captures fresh ownership inside serialized config removal, uses throwing disk-backed reads to verify ownership is gone, preserves project secrets until that verification succeeds, terminalizes every active owned turn, cancels queued follow-ups and pending auto-retries, then verifies quiescence once per workspace before deleting Project Chat state. Failed persistence, unreadable config, or failed shutdown preserves state instead of deleting underneath live/configured work. Fixed built-in agent resolution prevents custom overrides from broadening the tool surface. Project-owned creation follows effective project/global runtime defaults, fails on uncertain Git discovery, and rejects unsupported automatic remote/container creation rather than silently changing runtime type. Lifecycle operations revalidate exact ownership inside the per-workspace lock before mutation, retain existing archive/active/confirmation guards, and dual-root task/terminal-attention scans cover restart recovery. UI registration is auxiliary so normal workspace refreshes cannot remove the active Project Chat transcript.
Pains
The existing chat/session stack is deeply workspace-ID keyed, so the implementation required narrow compatibility seams rather than a parallel chat stack. The prior hidden Chat-with-Mux design also demonstrated why a fake workspace entry would be unsafe. Lockfile-free CI also exposed unpublished AI SDK patch versions selected by broad caret ranges, requiring exact production-provider pins. Storybook's repository-wide snapshot budget is currently above its exact checked-in ceiling on
main; this change keeps its added interaction story Pixel-disabled and uses the existing full-app stories for responsive visual coverage.Latest orchestration capabilities
agent_reportupdates to Project Chat while remaining durable ordinary workspaces. Progress does not settle the turn; the final assistant response and message reference still arrive throughtask_await.Generated with
mux• Model:openai:gpt-5.6-sol• Thinking:high• Cost:$1457.25