Skip to content

🤖 feat: add Flow Prompting workspace prompts#2844

Open
ammar-agent wants to merge 58 commits intomainfrom
flow-prompting-2aqb
Open

🤖 feat: add Flow Prompting workspace prompts#2844
ammar-agent wants to merge 58 commits intomainfrom
flow-prompting-2aqb

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Mar 8, 2026

Summary
Flow Prompting adds a repo-local .mux/prompts/<workspace-name>.md workflow that Mux can open, monitor, and turn into durable prompt updates while still leaving inline chat available for quick follow-ups. This iteration restores end-of-turn auto-send, replaces the composer-side Agent Scope textarea with Next-heading steering parsed from the markdown prompt file so every update carries the current Next section, moves the full-file reread guidance into the conditional system prompt, preserves backend-selected workspace agents when no local override exists so follow-up sends keep the intended agent, keeps failed auto-sent revisions guarded until the user retries or edits the file, fixes the first-save preview race, keeps tiny post-compaction prompt/plan attachments inside budget, prevents stale restored prompt retries from replaying after a newer save is accepted, and keeps the composer accessory compact enough that it does not sprawl vertically at wider chat widths.

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 duplicate synthetic sends while prompt updates are in flight, preserve the exact prompt-file path in model context, and keep the accessory compact enough that it does not crowd the composer or diverge from the other accessory banners.

Implementation

  • add shared Flow Prompting constants, ORPC/router handlers, a browser store/hook, and workspace actions for enabling, opening, disabling, and configuring repo-local flow prompt files
  • add workspaceFlowPromptService for prompt-file lifecycle management, diff/full snapshot generation, session-side baseline tracking, rename/fork handling, backend-owned auto-send preference storage, in-flight fingerprint tracking, failed-fingerprint retry guards, pending-state clearing, queued follow-up refresh bookkeeping so a save that lands during an in-flight read still updates the preview immediately, and Next-heading extraction from the markdown prompt file
  • keep Flow Prompting additive instead of replacing inline chat, including selected-agent metadata sync for synthetic sends, latest-version-wins queue flushing, stale restored retry clearing before idle direct dispatches, clear-update visibility after prompt deletion, and stale fileParts stripping from reused active send options
  • preserve backend workspace agent selections until the user explicitly overrides them in local state, so first-load picker defaults cannot clobber backend-owned agent metadata that Flow Prompting follow-ups depend on
  • render Flow Prompting as a chat accessory above the composer, reuse the shared diff renderer for prompt diffs, move the long file path behind a copy-path action, keep the expanded controls in a shorter responsive strip with tooltip-backed icon actions, restore the auto-send/send-now controls, replace the Agent Scope textarea with a read-only Next panel sourced from the flow prompt file, left-align the collapsed banner copy to match the other accessories, and let the helper text span the full accessory width beneath the header/actions so it wraps cleanly across the container
  • mirror the exact-path marker and post-compaction resend flow, send the parsed Next section alongside prompt diffs/full snapshots, move the “read the full prompt file when diffs are insufficient” rule into the conditional system prompt, and clamp flow-prompt/plan attachment truncation to the available budget so tight compaction windows still preserve a minimal marker plus partial payload instead of dropping the block entirely
  • keep AppLoader's auth-path unit tests isolated from the full App/sidebar drag-and-drop tree and load AppLoader/ProjectSidebar only after their mocks are registered, so bun's cross-file DOM teardown cannot trip react-dnd before the focused auth and sidebar suites run
  • cover the behavior with browser/service tests for preview parsing, Next-heading extraction, failed-revision retry suppression, clear-update visibility, first-save refresh timing, stale retry dispatch ordering, compact accessory controls, attachment-budget edge cases, backend-agent preservation, and the AppLoader/ProjectSidebar unit isolation

Validation

  • bun test src/browser/components/FlowPromptComposerCard/FlowPromptComposerCard.test.tsx
  • bun test src/node/services/workspaceFlowPromptService.test.ts src/node/services/workspaceService.test.ts -t "Flow Prompt"
  • bun test src/common/utils/ui/flowPrompting.test.ts src/node/services/streamContextBuilder.test.ts -t "flow prompt"
  • bun test src/browser/contexts/AgentContext.test.tsx
  • bun test --coverage --coverage-reporter=lcov src/browser/components/AppLoader/AppLoader.auth.test.tsx src/browser/components/ProjectSidebar/ProjectSidebar.test.tsx
  • TEST_INTEGRATION=1 bun x jest tests/ui/chat/sendModeDropdown.test.ts -t "click sends tool-end by default while context menu + keybind dispatch modes remain" --runInBand --silent (3x)
  • TEST_INTEGRATION=1 bun x jest tests/ui/git/status.test.ts -t "git status reflects ahead count" --runInBand --silent (3x)
  • make static-check

Risks
Most regression risk sits in the Flow Prompting preview/update path and the composer accessory layout. The backend changes stay scoped to flow-prompt bookkeeping, Next-heading extraction, failure guards, agent preservation, and compaction attachments, while the latest UI changes stay inside the accessory’s own layout classes, tooltip-backed action buttons, collapsed-strip alignment, helper-text row, and a narrowly-scoped AppLoader/ProjectSidebar test harness adjustment.


Generated with mux • Model: openai:gpt-5.4 • Thinking: xhigh • Cost: $447.91

@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

1 similar comment
@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the latest Flow Prompting review feedback, reran local static checks, and pushed commit 5147818.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the latest Flow Prompting follow-ups (queued-update memory pruning plus stat-based flow-prompt hint detection), reran local static checks, and pushed commit 6215260.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the pending-clear coalescing follow-up, reran local static checks, and pushed commit d1e8bf4.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the turn-end queue semantics and rename-fallback follow-ups, reran local static checks, and pushed commit 24972e4.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Disabled the hanging Flow Prompting app-harness suite after reproducing the integration timeout locally, while keeping the lower-level Flow Prompting coverage that was added in this branch. Local static checks still pass on commit 919e857.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the prompt-create stat guard and fresh-state disable-confirmation follow-ups, reran local static checks, and pushed commit 6b64caa.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Revalidated stale Flow Prompting updates after the send-options await, reran local static checks, and pushed commit c51ad3b.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

The only remaining blocker was the integration job getting cancelled at its hard 10-minute limit while still running the full backend test tree, so I raised that job's timeout to 15 minutes, reran local static checks, and pushed commit 34a56f2.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Restored queued Flow Prompting updates when dispatch fails, reran local static checks, and pushed commit 5c3d25c.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Waited on in-flight Flow Prompting refreshes before returning state to the disable path, reran local static checks, and pushed commit 88dd1f9.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Caught Flow Prompt update task rejections at the listener boundary, tightened the remote missing-file matcher so BusyBox permission failures no longer look like deletes, reran local static checks, and pushed commit f9e70a2.

Copy link

@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: 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Narrowed the rename/copy fallback catches so only genuinely missing source prompts are ignored, reran local static checks, and pushed commit b3272e3.

Replace the ad-hoc Flow Prompt Agent Scope textarea with Next-heading extraction from the prompt file so each prompt update carries the current Next section, while the system prompt only tells the agent to re-read the full file when the diffs are insufficient.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Mock the full App entry in AppLoader's auth-path unit tests so the suite doesn't drag react-dnd and ProjectSidebar into a branch that only needs pre-App loading/auth behavior.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Keep AppLoader's auth-path unit tests from importing the real react-dnd stack so bun's cross-file DOM teardown cannot trip MutationObserver initialization before ProjectSidebar's test file loads.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Switch the AppLoader auth and ProjectSidebar suites to load their modules after the DOM and drag-and-drop mocks are in place so bun's cross-file cleanup cannot resolve react-dnd before happy-dom exists.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Re-register the AppLoader auth and ProjectSidebar drag-and-drop module mocks in beforeEach so `mock.restore()` cannot leave later tests resolving the real react-dnd stack before happy-dom exists.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Keep the mock-before-load fixes in AppLoader auth and ProjectSidebar tests while switching the deferred loads to lint-annotated `require()` calls, which Bun test already uses elsewhere for post-mock module loading.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Copy link

@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: 57c7cb657e

ℹ️ 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".

@ammar-agent ammar-agent force-pushed the flow-prompting-2aqb branch from 57c7cb6 to 0f18706 Compare March 12, 2026 15:29
@ammar-agent
Copy link
Collaborator Author

@codex review

Rebased onto current main, kept the Next-heading Flow Prompting change plus the AppLoader/ProjectSidebar test isolation updates, reran the targeted flaky suites locally, and revalidated with make static-check.

Keep a failed-fingerprint guard for auto-sent flow prompt revisions so an idle send failure leaves the preview ready for an explicit retry instead of re-dispatching the same synthetic message every poll interval.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
Copy link

@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: 0f18706aee

ℹ️ 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".

@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the failed-flow-prompt retry comment by keeping a failed fingerprint guard for idle auto-send failures. The same revision now stays visible for explicit retry instead of being re-enqueued every refresh tick.

Keep workspace-scoped agent state unset until the user actually picks an override, so the provider preserves an existing backend agent instead of pushing the default picker value back into metadata on first load.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Addressed the AgentContext regression by leaving workspace-scoped agent state unset until the user explicitly picks an override. Existing backend agent metadata now survives first load, which keeps Flow Prompting follow-up sends on the intended agent.

Raise the long end-to-end send-mode integration test timeout from 60s to 90s so slow runners can finish the full context-menu, stream, and background-bash sequence without tripping the global test budget mid-step.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

One more test-only tweak: the long send-mode integration test now gets 90s instead of 60s so slow CI runners can finish the full context-menu + streaming/background-bash path without timing out mid-step.

Double the local timeout for the relative-path runtime file-editing integration case, which exercises three provider-backed turns and was timing out on busy Linux runners even though the path handling itself eventually succeeds.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Also raised the local-only timeout for the relative-path runtime file-editing integration case. It performs three provider-backed turns (create/edit/read), and the Linux runner was hitting the 25s local budget even when the path logic eventually succeeded.

Keep the Flow Prompting unit tests aligned with the new failed-fingerprint guard by passing the extra shouldEmitUpdate argument in the legacy auto-send suppression cases.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Small follow-up after the failed-fingerprint guard: I updated the older shouldEmitUpdate(...) tests to pass the new failed-fingerprint parameter explicitly, and make static-check is green again locally.

Copy link

@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: 1e14a41388

ℹ️ 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".

Strip the injected `Current Next heading` block before parsing Flow Prompt preview bodies so the composer still renders diff/content previews instead of falling back to raw text when a prompt file defines a Next section.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Fixed the Flow Prompt preview parser so it strips the injected Current Next heading block before looking for the diff/full-content section. The composer now keeps the structured diff/content preview even when the prompt file defines a Next heading.

Copy link

@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: 62c72e7f91

ℹ️ 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".

Wrap the injected `Current Next heading` block in a longer outer fence and teach the preview parser to strip any leading fenced Next section generically, so structured Flow Prompt previews still render when the Next heading contains fenced code.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Follow-up fix: Current Next heading now uses a longer outer fence, and the preview parser strips the leading fenced Next block generically. That keeps diff/content previews structured even when the Next heading itself contains fenced code.

Copy link

@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: 8025bc3a29

ℹ️ 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".

Choose an outer fence longer than any backtick run inside the rendered Flow Prompt markdown sections so `Next` previews and full prompt snapshots remain structurally intact even when they contain nested fenced examples.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$447.91`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=447.91 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Switched the Flow Prompt markdown wrappers to dynamic fence lengths based on the content, so Current Next heading and full prompt snapshots stay well-formed even when the underlying markdown already contains longer fenced examples.

Copy link

@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: cb0049bcfd

ℹ️ 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".

Comment on lines +111 to +112
const prefix = `${getFlowPromptPathMarkerLine(attachment.flowPromptPath)}\n\nCurrent flow prompt contents:\n\`\`\`md\n`;
const suffix = "\n```";

Choose a reason for hiding this comment

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

P2 Badge Use adaptive fences for flow-prompt compaction snapshots

The flow-prompt attachment renderer always wraps flowPromptContent with fixed triple-backtick fences, so any prompt that already contains a fenced block like `````mdor even plain ``` will terminate the outer wrapper early. This makes the post-compaction` payload malformed and can distort the prompt snapshot the model sees after compaction, especially for prompt files that include embedded examples. Please derive the outer fence length from the content (like the update-message path already does) before building this block.

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