fix(codex): discourage early exec yielding for one-shot commands#2628
Merged
Conversation
Add model-facing guidance so routine shell commands wait for completion instead of creating unnecessary background sessions and follow-up polls. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
Map release-dated OpenAI registry handles to undated local Pi catalog ids when the exact model id is not present, unblocking local gpt-5-mini CI. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exec_commandso ordinary one-shot commands omityield_time_msand wait for completion.openai/gpt-5-mini-2025-08-07, which the Pi OpenAI catalog exposes as undated ids likegpt-5-mini.Why
Upstream Codex exposes
yield_time_mstersely as a wait-before-yield knob. In Letta Code we observed GPT-5.5 applyingyield_time_ms: 1000to ordinarygh run view ... --json jobs --jq ...commands. Because those commands often take ~1.5s, each one returnedProcess running with session ID ..., then the next model turn issued emptywrite_stdinpolls. In the three-command reproduction this produced three background sessions plus three follow-up polls for commands that would have completed inline with the default wait.This intentionally strays from the source/reference tool description by adding model-facing guidance while preserving the Codex-compatible schema and runtime behavior.
The local CI failure was a separate model-catalog mismatch exposed by this PR run:
gpt-5-mini-mediumresolves throughmodels.jsontoopenai/gpt-5-mini-2025-08-07, but the local Pi OpenAI catalog exposesgpt-5-mini. Local backend model resolution now falls back from OpenAI release-dated ids to the undated catalog id when the exact id is absent.Test plan
bun test src/tools/codex-unified-exec-toolset.test.tsbun test src/backend/pi-model-factory.test.tsbun run checkbun run src/test-utils/headless-scenario.ts --backend local --model gpt-5-mini-medium --output text --parallel on(local run skipped because this environment lacksOPENAI_API_KEY; CI will exercise it with secrets)agent-local-c47c57d5-72c5-4f23-baea-3fb1d441273e) on the exact three Caren screenshot commands:exec_commandcalls withyield_time_ms: 1000, threeProcess running with session ID ...results, and three emptywrite_stdinpolls.exec_commandcalls with noyield_time_ms, nowrite_stdinpolls, and inline completion in ~1.4-1.6s each.👾 Generated with Letta Code