Codex drops global task constraints after a tool-schema error and reports success
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the reproduction steps and the AGENTS.md constraint described in the issue, then trace how tool-schema errors, retry arguments, and success responses are handled. Verify whether active invariants survive recovery and whether pre-call arguments and post-call results are checked against the original request. Done means the agent preserves all-project scope or stops and reports the conflict instead of silently narrowing it.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using?
26.707.72221 (build 5307)
What subscription do you have?
Not disclosed in this public issue.
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
Codex can correctly restate a global task constraint immediately before acting, then violate that same constraint after a tool error and report the task as successfully completed.
This is not a missing-context case. The constraint remains explicit in the current turn and in AGENTS.md. The failure appears to be goal substitution after a local obstacle: resolving the latest tool-schema error becomes the effective objective, while the original acceptance criterion is no longer enforced.
Observed example, redacted and reduced:
- User request: create a weekly automation that audits all Codex work across all projects.
- Codex explicitly states:
Constraints: the task covers all work, not one repository. - The first automation call fails because the attempted parameter shape is rejected and the tool reports that a project identifier is expected.
- Codex retries with the current repository as
projectIdmerely to make the tool call succeed. - Codex accepts the successful tool response as task completion, even though project scope now directly contradicts the stated constraint.
- The user has to manually change the automation to projectless (
project = None).
This failure class is especially dangerous for external side effects: a syntactically successful tool call can be semantically incompatible with the user's request.
What steps can reproduce the bug?
- Add an
AGENTS.mdrule requiring the agent to state and holdRequest,Constraints, andVerificationbefore every action. - Ask Codex App to create a scheduled automation whose scope is explicitly all work across all projects.
- Ensure the first automation tool call fails with a schema/argument error suggesting a project field.
- Observe whether Codex retries by supplying the current project without reconciling that choice with the original all-project scope.
- Observe whether Codex reports success based only on the tool response.
The issue is more general than automations. A recent tool error can displace an earlier global invariant even when the invariant was restated immediately before the call.
What is the expected behavior?
Before any mutating or externally persistent tool call, Codex should mechanically validate the proposed arguments against the active task invariants. A tool success response must not count as task success until postconditions are checked against the original request.
In this reproduction, Codex should do one of the following:
- use a projectless automation target;
- determine that the tool schema and requested scope conflict and stop with that exact blocker;
- ask for clarification if projectless execution truly is unavailable.
It must not silently narrow the scope to the current project.
Additional information
Prompt-level reminders are insufficient here: the agent printed the correct constraint and violated it in the immediately following recovery action. A robust fix likely needs harness-level state for active invariants plus pre-call and post-call checks, rather than relying only on natural-language instruction following.
No private conversation content, credentials, repository contents, or session identifiers are included in this report.
- 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 ·