Nested exec can orphan a mutating child while outer wait reports complete
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Trace the lifecycle of functions.exec and its nested tools.exec_command calls, focusing on how nested session_id values and outer cell completion are handled. Reproduce the slow filesystem-mutation case, then add a regression test covering a live child after the outer cell reports completion. Done means an outer completed result cannot coexist with an unreported live child process.
Written by the indexing model from the issue text.
Description
Summary
A long-running tools.exec_command invoked inside functions.exec can yield with its own session still running. If the wrapper only emits result.output, the nested session_id is discarded. Waiting on the outer functions.exec cell can then report completion even though the child shell process is still mutating the filesystem.
Observed impact
This happened during a large git switch. The outer cell completed with no output while the Git process continued in the background holding index.lock. A later status check raced the checkout. When the orphaned Git process was stopped, HEAD and the index were unchanged, but the working tree had been only partially transitioned: thousands of tracked deletions/modifications plus hundreds of untracked files. Recovery was possible only because HEAD/index remained intact and the filesystem state was separately preserved.
Reproduction shape
- Call
functions.exec. - Inside it, await
tools.exec_commandfor a command that runs beyond the nested yield window. - Emit only
result.output, omittingresult.session_id. - The outer call yields a cell ID; wait on that cell.
- Observe the outer cell complete while the nested child process remains alive.
Expected safety behavior
One of the following should hold:
functions.execautomatically retains and surfaces nested exec session IDs;- the outer cell remains alive until every awaited nested exec finishes;
- nested long-running exec calls are rejected unless their session handle is explicitly consumed; or
- child processes are terminated when the outer isolate completes.
For mutating commands, an outer completed result must not coexist with an unreported live child process. A regression test using a slow filesystem mutation would be valuable.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·