Skip to content

Evaluate AGENTS.md and skills with Codex - #70120

Open
RoyLee1224 wants to merge 1 commit into
apache:mainfrom
RoyLee1224:feat/skill-eval-codex-runtime
Open

Evaluate AGENTS.md and skills with Codex#70120
RoyLee1224 wants to merge 1 commit into
apache:mainfrom
RoyLee1224:feat/skill-eval-codex-runtime

Conversation

@RoyLee1224

@RoyLee1224 RoyLee1224 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

cc: @jason810496

Follow up on #69308 by adding Codex as an alternative runtime for evaluating AGENTS.md and skills through promptfoo's built-in Codex SDK provider.

Run the evaluation with Codex:

AGENT_RUNTIME=codex \
  prek run run-skill-eval --hook-stage manual --all-files

The evaluation completed all six cases with no provider errors. Four behavioral assertions passed and two existing ambiguous newsfragment cases failed.

CleanShot 2026-07-20 at 17 26 29@2x CleanShot 2026-07-20 at 17 26 48@2x
Was generative AI tooling used to co-author this PR?
  • Yes gpt-5.6-sol

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Important

🛠️ Maintainer triage note for @RoyLee1224 · by @potiuk · 2026-07-28 16:32 UTC

Some review feedback from jason810496 is waiting on you:

  • There are 5 unresolved review threads on this PR from jason810496.

The ball is in your court — you've been assigned to this PR. Push a fix or reply in each thread explaining why the feedback does not apply, then mark them resolved and ping the reviewer (jason810496) for a final look.

See the Pull Request quality criteria for how to fix each item. There is no rush.

Note: your branch is 225 commits behind main — please rebase and push again to get up-to-date CI results.

Automated triage — may be imperfect; a maintainer takes the next look. We use this two-stage triage process so maintainers' limited time goes to the conversation with you.

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for adding the Codex support!

Comment thread dev/skill-evals/eval.py Outdated
installed_version = json.loads(package_json.read_text())["version"]
except (OSError, KeyError, ValueError):
continue
if installed_version == expected_version:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this means that we force the contributor to use the exact same version we pin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but prek installs the pinned version automatically, so contributors do not select or install it themselves.

I removed the version comparison. The code now selects the SDK installed by the hook instead of promptfoo's bundled copy.

Comment thread .pre-commit-config.yaml
Comment on lines -1022 to +1025
additional_dependencies: ['promptfoo@0.121.17', '@anthropic-ai/claude-agent-sdk@0.3.185']
additional_dependencies:
- 'promptfoo@0.121.17'
- '@anthropic-ai/claude-agent-sdk@0.3.185'
- '@openai/codex-sdk@0.144.6'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or does it means we will use the Claude / Codex install by prek? Would it be possible to relex as to use system wise CLI first then fallback to prek installed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is technically possible, but prek would still install the fallback before the hook runs, so it would not reduce the download. It would also make the eval depend on an unpinned system CLI.

I prefer keeping the CLI managed by the separate manual prek hook for reproducible runs. Authentication still comes from the user's existing session.

Comment thread .pre-commit-config.yaml
entry: ./dev/skill-evals/eval.py
language: node
language_version: '22.22.0'
additional_dependencies: ['promptfoo@0.121.17', '@anthropic-ai/claude-agent-sdk@0.3.185']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's fine for promptfoo as most of the user won't have it but I think we can assume most of the contributor have either Claude or Codex. Since we will pull ~310–350 MB Codex CLI binary, including Claude-only users now.

@RoyLee1224 RoyLee1224 Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. I split Codex into a separate manual hook. The existing Claude hook is unchanged, so Claude-only users get no additional download from this PR.

The Codex hook installs a newer SDK because promptfoo's bundled Codex binary is signed with a revoked certificate and macOS blocks it. This is also reported in openai/codex #22135.

Comment thread dev/skill-evals/eval.py
return {"id": "anthropic:claude-agent-sdk", "label": label, "config": config}


def build_codex_provider(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a real comment but a interesting finding by claude.
Fortunately, our next steps is shirking the AGENTS.md haha.


Codex silently truncates AGENTS.md at 32 KiB, and Airflow's AGENTS.md is already 35,417 bytes, so a Codex-runtime eval can measure nothing while recording proof it ran (CONFIRMED)
Codex's DEFAULT_PROJECT_DOC_MAX_BYTES is 32,768 and codex-rs prefix-truncates project docs silently; build_codex_provider sets cli_config only for history persistence and never raises project_doc_max_bytes, even though promptfoo spreads cli_config straight into Codex config overrides. Since arms differ only in AGENTS.md, any guidance edit landing past the 32,768-byte boundary (the file's last ~2.6 KB, where new guidance is typically appended) produces byte-identical visible guidance in both arms — the exact "eval silently measures nothing" failure mode check_claude_md_symlink guards against on the Claude side, and the hash is still recorded as proof. Fix is one line: add project_doc_max_bytes to cli_config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thanks! The Codex provider now raises project_doc_max_bytes so the complete AGENTS.md is included in the evaluation.

Comment thread dev/skill-evals/eval.py
Comment on lines +49 to +52
SDK_PACKAGES = {
"claude": ("@anthropic-ai/claude-agent-sdk", "0.3.185"),
"codex": ("@openai/codex-sdk", "0.144.6"),
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or another direction, we could define the lower bound for the CLI version. (Thought I have no idea how should we pin the version at this moment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the comparison instead of adding a lower bound. A lower bound could still select promptfoo's bundled SDK, while additional_dependencies already defines the version used by the hook.

@RoyLee1224
RoyLee1224 force-pushed the feat/skill-eval-codex-runtime branch from cfbf9d2 to 2efdf52 Compare July 30, 2026 07:36
@RoyLee1224
RoyLee1224 force-pushed the feat/skill-eval-codex-runtime branch from 2efdf52 to f1d0ecc Compare July 30, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants