🤖 feat: add Flow Prompting workspace prompts#2844
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acc20746d3
ℹ️ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a80485cd4
ℹ️ 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 |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 152a70b23e
ℹ️ 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: 514781851b
ℹ️ 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: 62152607ed
ℹ️ 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: d1e8bf49f3
ℹ️ 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: Didn't find any major issues. 👍 ℹ️ 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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 919e8572e4
ℹ️ 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: 6b64caa242
ℹ️ 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: Didn't find any major issues. Keep it up! ℹ️ 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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34a56f2347
ℹ️ 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: 5c3d25cdd4
ℹ️ 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: 88dd1f9866
ℹ️ 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: f9e70a24d8
ℹ️ 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 selected workspace agent mirrored to backend metadata so Flow Prompting follow-up sends reuse the visible mode instead of falling back to auto. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$232.31`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=232.31 -->
Add a keyboard shortcut and inline hint for opening Flow Prompting, and keep the flow prompt banner aligned to the same max-width container as the chat input. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$232.53`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=232.53 -->
89d971d to
699b6cc
Compare
|
@codex review Rebased onto origin/main, fixed the Flow Prompting agent-mode drift bug, and added the requested composer UX polish: a keyboard shortcut hint in ChatInput plus a max-width-aligned flow prompt banner. |
Show pending Flow Prompting diffs in the shared queued-message UI so editor saves surface as visible queued user input while the current step is still running. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$237.42`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=237.42 -->
|
@codex review Added the missing Flow Prompting queue preview: pending prompt-file diffs now render through the shared queued-message UI (including pending deletes), while preserving the latest-wins coalescing behavior. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a19d62de0d
ℹ️ 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".
--- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$247.10`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=247.10 -->
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c88383c02
ℹ️ 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".
--- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$247.10`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=247.10 -->
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ea3181663
ℹ️ 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".
Tighten the integrated Flow Prompting chrome so it sits flush with the textarea, keeps the controls aligned on one row more often, and trims extra preview height. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$287.21`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=287.21 -->
Track in-flight Flow Prompting fingerprints so the poller does not re-emit the same revision while an immediate synthetic send is still being prepared or sent, and sanitize flow prompt filenames for in-place workspaces whose names are absolute paths. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$287.21`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=287.21 -->
|
@codex review Addressed the duplicate Flow Prompting dispatch race by tracking in-flight fingerprints during immediate synthetic sends, and sanitized flow prompt filenames for in-place workspaces whose names are absolute paths. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86beff3e7d
ℹ️ 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".
Add a collapsed Flow Prompting strip that docks beside the textarea so users can recover chat height without disabling the feature, and trim the preview down to the actual diff/content instead of repeating the synthetic wrapper instructions. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$287.21`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=287.21 -->
|
@codex review Added a collapsible Flow Prompting strip that docks beside the textarea, and trimmed the composer preview down to the actual diff/content instead of the full synthetic wrapper text. |
Move the Flow Prompting control back into the accessory stack above the chat input, collapse it into a horizontal banner row, and keep the preview/content layout consistent with the other chat accessories. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$287.21`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=287.21 -->
|
@codex review Adjusted the Flow Prompting accessory to match the other banner-style accessories above chat input: it now collapses to a horizontal strip, stays in the accessory stack instead of docking against the textarea, and keeps the preview trimmed to the actual diff/content. |
Preserve slash-delimited workspace names when deriving flow prompt paths so branch workspaces stay unique, and strip inherited file attachments from active send options before reusing them for synthetic Flow Prompting updates. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$287.21`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=287.21 -->
|
@codex review Fixed the two remaining Flow Prompting issues: branch-style workspace names now keep their slash-delimited path segments unless the workspace name is a true absolute filesystem path, and synthetic Flow Prompting sends now drop inherited |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e257904ce
ℹ️ 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".
| if (pendingSelectedAgentSyncRef.current != null) { | ||
| return; |
There was a problem hiding this comment.
Keep flushing queued agent sync requests after in-flight call
If a workspace-scoped updateSelectedAgent call is already in flight, this early return drops out before processing queuedSelectedAgentSyncRef. A later selection change can be queued while the first request is pending, but when that first request resolves only refs are updated (no state change), so no rerender re-triggers flushSelectedAgentSync and the queued sync can remain unsent. In that case backend workspace metadata stays on the old agent, and backend-driven follow-up sends (e.g. Flow Prompting synthetic sends) can run under a stale agentId.
Useful? React with 👍 / 👎.
Summary
Flow Prompting adds a repo-local
.mux/prompts/<workspace-name>.mdfile that Mux can open, monitor, and turn into durable prompt updates while still leaving inline chat available for quick follow-ups.Background
The goal is to reduce the “wait vs. context-switch” tax of agentic work by moving durable task guidance into a workspace artifact that can stay open in the user's editor. The implementation also needs to work across local and remote runtimes, avoid wasting expensive runtime reads on stale workspaces, keep the lighter-weight inline chat loop intact for one-off asks, avoid duplicate synthetic sends while prompt updates are in flight, keep branch-scoped prompt files unique, and keep the Flow Prompting accessory compact enough that it does not steal too much chat space or shift the input layout around.
Implementation
WorkspaceFlowPromptServicefor prompt-file lifecycle management, diff/full snapshot generation, session-side baseline tracking, recency-aware polling, backend-owned auto-send preference storage, and in-flight fingerprint tracking so the poller does not re-emit the same revision during an immediate synthetic sendfilePartsfrom reused active send options so synthetic Flow Prompting updates do not resend stale user attachmentsValidation
bun test src/common/constants/flowPrompting.test.tsbun test src/node/services/workspaceFlowPromptService.test.tsbun test src/node/services/workspaceService.test.tsbun test src/node/services/agentSession.queueDispatch.test.tsbun test src/browser/components/FlowPromptComposerCard/FlowPromptComposerCard.test.tsxbun x jest tests/ui/chat/sendModeDropdown.test.ts --runInBandmake lintmake typecheckmake static-checkRisks
This touches prompt plumbing across browser, ORPC, session, compaction, and UI integration layers, so regressions would most likely show up in flow prompt enable/disable state, auto-send queue timing, post-compaction prompt restoration, remote-runtime polling cadence, prompt-file path collisions, or the interaction between editor-driven prompts and inline chat.
Generated with
mux• Model:openai:gpt-5.4• Thinking:xhigh• Cost:$287.21