Skip to content

Fix Codex adapter size budget validation#73

Merged
Mathews-Tom merged 2 commits into
mainfrom
fix/codex-adapter-size-budget
May 29, 2026
Merged

Fix Codex adapter size budget validation#73
Mathews-Tom merged 2 commits into
mainfrom
fix/codex-adapter-size-budget

Conversation

@Mathews-Tom
Copy link
Copy Markdown
Owner

Summary

Fixes the Package All CI failure where scripts/generate_adapters.py --validate rejected the generated Codex root AGENTS.md for exceeding the 32 KiB budget.

This branch updates the Codex adapter index generation and adds focused regression coverage for the budget contract.

Changes

  • Tightens truncate_description() so max_chars includes the appended ellipsis instead of allowing truncated strings to exceed the requested limit.
  • Adds CodexAdapter.ROOT_DESCRIPTION_MAX_CHARS and applies it consistently to root index entries for rules, agents, commands, and skills.
  • Reduces generated Codex root AGENTS.md size from the failing 32,798 bytes to 23,347 bytes, 71% of the 32 KiB budget.
  • Adds tests/test_generate_adapters.py coverage that generates the Codex adapter from the real package set and asserts the root file stays within the configured size budget.
  • Adds a focused truncation-limit test so future changes cannot silently reintroduce oversized root descriptions.

Validation

  • uv run python scripts/generate_manifest.py && git diff --exit-code manifest.yaml && uv run python scripts/generate_adapters.py --validate
  • uv run pytest tests/test_generate_adapters.py
  • git diff --check main..HEAD

Notes

  • Repo-wide uv run pytest passed locally before this branch was pushed: 410 tests passed.
  • Repo-wide ruff check, repo-wide ruff format --check ., and targeted mypy --strict are not clean in the current checkout due to existing unrelated lint, formatting, and typing debt. The failing GitHub Actions job does not run those gates.

@Mathews-Tom Mathews-Tom merged commit 2339f7e into main May 29, 2026
2 checks passed
@Mathews-Tom Mathews-Tom deleted the fix/codex-adapter-size-budget branch May 29, 2026 02:06
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