Skip to content

state: add explicit native goal execution leases - #797

Merged
GraciousGazelles merged 7 commits into
mainfrom
validation/w13351-goal-execution-lease-20260907
Sep 6, 2026
Merged

GraciousGazelles merged 7 commits into
mainfrom
validation/w13351-goal-execution-lease-20260907

Conversation

@GraciousGazelles

Copy link
Copy Markdown
Collaborator

Summary

  • add an explicit, nonblocking per-thread execution lease to codex-state
  • retain the native lock handle across cloned lease values and runtime/store drops
  • cover same-process, cross-process, lifetime, stable-path, and independent-thread behavior

Validation

  • GitHub Actions rust-ci-full run 34043020165
  • Linux x86_64 checks, tests, remote tests, formatting, lint/build, release lint/build, and full CI results passed

This change is limited to the native execution lease primitive; higher-level goal continuation and control behavior are not included.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-06T16:29:43.565353Z 9204651 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a non-blocking advisory file locking mechanism, GoalExecutionLease, to manage execution leases for thread goals. While the implementation is a solid addition, there are two critical issues: first, the code will fail to compile because std::fs::File lacks a try_lock method and std::fs::TryLockError does not exist in the standard library (requiring an external crate like fs2); second, the try_acquire_goal_execution_lease async function performs blocking file I/O directly on the async executor thread, which should be offloaded to tokio::task::spawn_blocking to prevent thread starvation.

Comment thread codex-rs/state/src/runtime.rs Resolved
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Sep 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 6, 2026
@GraciousGazelles
GraciousGazelles added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit e94d798 Sep 6, 2026
128 of 134 checks passed
@GraciousGazelles
GraciousGazelles deleted the validation/w13351-goal-execution-lease-20260907 branch September 6, 2026 21:54
sedna-release-publisher Bot pushed a commit that referenced this pull request Sep 15, 2026
* state: add explicit goal execution leases

* test: handshake native goal lease contention

* test: frame goal lease subprocess markers

* test: match framed goal lease markers

* state: make goal lease quality clean

* test: apply hosted formatting corrections
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.

2 participants