Skip to content

fix(installer): trim codegraph skill description under Codex's 1024-char limit#163

Merged
sunerpy merged 1 commit into
mainfrom
fix/codex-skill-description-limit
Jul 19, 2026
Merged

fix(installer): trim codegraph skill description under Codex's 1024-char limit#163
sunerpy merged 1 commit into
mainfrom
fix/codex-skill-description-limit

Conversation

@sunerpy

@sunerpy sunerpy commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

The codegraph agent skill was invisible in OpenAI Codex's skill list (no warning), while sibling skills in the same ~/.agents/skills/ dir loaded fine.

Root cause, verified against Codex source openai/codex @ codex-rs/core-skills/src/loader.rs: the loader enforces MAX_DESCRIPTION_LEN = 1024 chars on a skill's front-matter description (after sanitize_single_line collapses whitespace to single spaces). An over-limit description becomes a SkillParseError::InvalidField, which routes the skill into outcome.errors (NOT outcome.skills) — because it's an invalid-field error rather than a context-budget omission, no warning is surfaced; the skill just silently vanishes.

The codegraph SKILL.md description folded to 1026 chars — 2 over the limit.

Changes

  • skills/codegraph/SKILL.md: trim the front-matter description from 1026 → 706 folded chars, preserving the core trigger intent and a representative CJK trigger subset. Body (Part A / Part B) is byte-for-byte unchanged.
  • crates/codegraph-cli/src/installer/skill.rs: add a fail-closed unit test skill_description_within_codex_limit that isolates the front-matter, requires exactly one non-empty description: > folded scalar, replicates Codex's fold (split_whitespace().join(" ")), and asserts the char count stays <= 1024 (Codex's contract) and <= 950 (maintenance margin). Std-only, no new dependency.

The install path (~/.agents/skills) is unchanged and correct — it is Codex's current user-scope skills root (~/.codex/skills is the deprecated back-compat location per the loader source). Only the over-long description was at fault.

Not touched: codex.rs skill_dir(), golden/equivalence fixtures, no hardcoded hashes.

Verification

  • make ci green locally (fmt-check + clippy + test + guardrail)
  • new guard test passes: installer::skill::tests::skill_description_within_codex_limit ... ok
  • pre-push hook passed

…har limit

Codex's skill loader (core-skills/src/loader.rs) enforces
MAX_DESCRIPTION_LEN=1024 chars on a skill's front-matter description
(after collapsing whitespace to single spaces). An over-limit
description becomes an InvalidField parse error that routes the skill
into outcome.errors instead of outcome.skills, so the skill silently
disappears from Codex's skill list with NO warning. The codegraph
SKILL.md description folded to 1026 chars — 2 over — so codegraph was
invisible in Codex while sibling skills in the same ~/.agents/skills
dir loaded fine.

Trim the description to 706 folded chars (preserving the core trigger
intent and a representative CJK trigger subset) and add a fail-closed
unit test that replicates Codex's fold algorithm and asserts the
folded length stays <=1024 (Codex's contract) and <=950 (maintenance
margin), so this can never regress.

The skill install path (~/.agents/skills) is unchanged and correct —
it is Codex's current user-scope skills root; only the over-long
description was at fault.
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.31373% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/codegraph-cli/src/installer/skill.rs 84.31% 8 Missing ⚠️

❌ Your patch check has failed because the patch coverage (84.31%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
- Coverage   95.27%   95.26%   -0.02%     
==========================================
  Files         124      124              
  Lines       61140    61191      +51     
==========================================
+ Hits        58252    58293      +41     
- Misses       2888     2898      +10     
Files with missing lines Coverage Δ
crates/codegraph-cli/src/installer/skill.rs 94.16% <84.31%> (-1.47%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit bc7fc3b into main Jul 19, 2026
7 checks passed
@sunerpy
sunerpy deleted the fix/codex-skill-description-limit branch July 19, 2026 16:30
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