Skip to content

feat(core): enforce workspace mutation ordering [2 of 5]#25339

Open
fcoury-oai wants to merge 3 commits into
fcoury/multi-dir-runtime-statefrom
fcoury/multi-dir-tool-ordering
Open

feat(core): enforce workspace mutation ordering [2 of 5]#25339
fcoury-oai wants to merge 3 commits into
fcoury/multi-dir-runtime-statefrom
fcoury/multi-dir-tool-ordering

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented May 30, 2026

Copy link
Copy Markdown
Contributor

Why

A directory mutation cannot execute like an ordinary parallel tool call. Calls after it must observe the updated cwd and permission context, and they must not run against stale state if the mutation fails.

What Changed

  • Add an explicit ToolExecutionPolicy with parallel and barrier-and-cancel-suffix modes.
  • Execute preceding calls before a barrier, run the barrier exclusively, and release later calls only after success.
  • Emit dependency_cancelled outputs for calls skipped behind a failed mutation barrier.
  • Preserve ordinary parallel execution between barriers.
  • Share dependency-failure construction and test setup across the ordering paths.

How to Test

  1. Submit a batch with ordinary calls before and after a successful barrier.
  2. Confirm calls before the barrier complete first and suffix calls start only after success.
  3. Repeat with a failed barrier.
  4. Confirm suffix calls are not dispatched and receive dependency_cancelled outputs.

Targeted tests:

  • failed_barrier_cancels_suffix_without_dispatching_it
  • The focused tests in core/src/tools/parallel.rs

Stack

  1. #25336 runtime workspace state
  2. feat(core): enforce workspace mutation ordering [2 of 5] #25339(feat(core): enforce workspace mutation ordering [2 of 5] #25339) ordered mutation barriers (this PR)
  3. #25334 model workspace tools
  4. #25338 approval projection
  5. #25335 TUI workspace commands

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: a7dd521da4

ℹ️ 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 thread codex-rs/core/src/tools/orchestrator.rs
Comment thread codex-rs/core/src/tools/parallel.rs
Comment thread codex-rs/core/src/tools/parallel.rs Outdated
Comment thread codex-rs/core/src/tools/parallel.rs Outdated
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch 2 times, most recently from eb798f8 to 7095747 Compare May 30, 2026 22:34
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch 4 times, most recently from 655d3d8 to 7061d0a Compare May 31, 2026 00:22
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from 8f426d8 to b519ecb Compare June 3, 2026 18:54
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch 2 times, most recently from 3298e20 to ff7f72c Compare June 3, 2026 19:46
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from b519ecb to e726188 Compare June 3, 2026 19:46
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch from ff7f72c to 4752cc0 Compare June 3, 2026 21:00
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from bd74c54 to 06c6dc4 Compare June 3, 2026 21:37
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch from 4752cc0 to b20432c Compare June 3, 2026 21:37
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from 06c6dc4 to a54c1c6 Compare June 3, 2026 22:15
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch 4 times, most recently from 2de1f60 to 904629e Compare June 3, 2026 23:23
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from a54c1c6 to dff59a0 Compare June 5, 2026 17:09
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch from 904629e to cd09970 Compare June 5, 2026 17:09
@fcoury-oai fcoury-oai changed the title feat(core): order workspace mutation tool calls [3 of 6] feat(core): enforce workspace mutation ordering [2 of 5] Jun 5, 2026
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-runtime-state branch from dff59a0 to 8ccab0f Compare June 5, 2026 17:33
@fcoury-oai fcoury-oai force-pushed the fcoury/multi-dir-tool-ordering branch from cd09970 to f5ecd1a Compare June 5, 2026 17:34
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