Skip to content

fix(codex): discourage early exec yielding for one-shot commands#2628

Merged
cpacker merged 2 commits into
mainfrom
fix/codex-exec-yield-guidance
May 30, 2026
Merged

fix(codex): discourage early exec yielding for one-shot commands#2628
cpacker merged 2 commits into
mainfrom
fix/codex-exec-yield-guidance

Conversation

@cpacker
Copy link
Copy Markdown
Collaborator

@cpacker cpacker commented May 30, 2026

Summary

  • Adds a short Letta-specific guidance sentence to exec_command so ordinary one-shot commands omit yield_time_ms and wait for completion.
  • Updates the unified exec description alignment test to document the intentional deviation from the upstream Codex wording.
  • Fixes local backend OpenAI model resolution for release-dated registry handles like openai/gpt-5-mini-2025-08-07, which the Pi OpenAI catalog exposes as undated ids like gpt-5-mini.

Why

Upstream Codex exposes yield_time_ms tersely as a wait-before-yield knob. In Letta Code we observed GPT-5.5 applying yield_time_ms: 1000 to ordinary gh run view ... --json jobs --jq ... commands. Because those commands often take ~1.5s, each one returned Process running with session ID ..., then the next model turn issued empty write_stdin polls. 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-medium resolves through models.json to openai/gpt-5-mini-2025-08-07, but the local Pi OpenAI catalog exposes gpt-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.ts
  • bun test src/backend/pi-model-factory.test.ts
  • bun run check
  • bun run src/test-utils/headless-scenario.ts --backend local --model gpt-5-mini-medium --output text --parallel on (local run skipped because this environment lacks OPENAI_API_KEY; CI will exercise it with secrets)
  • Local model probe with Big Chungus the 3rd (agent-local-c47c57d5-72c5-4f23-baea-3fb1d441273e) on the exact three Caren screenshot commands:
    • Before this description guidance: local transcript showed three exec_command calls with yield_time_ms: 1000, three Process running with session ID ... results, and three empty write_stdin polls.
    • After the longer additive guidance and after this shorter guidance: local transcripts showed three exec_command calls with no yield_time_ms, no write_stdin polls, and inline completion in ~1.4-1.6s each.

👾 Generated with Letta Code

cpacker and others added 2 commits May 29, 2026 19:57
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>
@cpacker cpacker merged commit 861626a into main May 30, 2026
18 checks passed
@cpacker cpacker deleted the fix/codex-exec-yield-guidance branch May 30, 2026 03:13
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