Skip to content

fix(codex): catch up to rust-v0.122.0 (8 new top-level config keys) - #758

Merged
avifenesh merged 3 commits into
mainfrom
chore/triage-codex-0-122-0
Apr 23, 2026
Merged

fix(codex): catch up to rust-v0.122.0 (8 new top-level config keys)#758
avifenesh merged 3 commits into
mainfrom
chore/triage-codex-0-122-0

Conversation

@avifenesh

Copy link
Copy Markdown
Collaborator

Summary

Triage of openai/codex rust-v0.118.0 -> rust-v0.122.0 (issue #747). About 150 PRs in the bump window; only one structural change actually affects agnix's lint surface.

The fix

Upstream config-schema.json (verified 2026-04-22) gained 8 new top-level keys. Without this PR, agnix would false-positive CDX-CFG-006 (unknown top-level config key) on any current Codex config.toml that uses any of them:

  • experimental_realtime_start_instructions
  • experimental_realtime_ws_startup_context
  • include_apps_instructions
  • include_environment_context
  • include_permissions_instructions
  • marketplaces
  • realtime
  • tool_suggest

Added all 8 to KNOWN_CONFIG_TOP_LEVEL_KEYS in crates/agnix-core/src/rules/codex.rs (alphabetical insert). Added a regression test using all 8 in a single config file and asserting zero CDX-CFG-006 diagnostics.

Other inspected upstream changes that need NO agnix change

Upstream Why no agnix change
MCP server env config (#18085) env/env_vars already in KNOWN_MCP_SERVER_KEYS
AGENTS.md discovery refactor (#18035) Internal Codex refactor; file format/semantics unchanged
Filesystem deny-read globs (#15979, #17740, #18096) permissions already a known top-level key; agnix doesn't drill into sub-objects
PermissionRequest hooks (#17563) agnix doesn't validate Codex hooks today
models.json removal (#18585) CDX-CFG-014 is a type-only check (no static model list)
Plugin marketplace (#17277, #18017, #18222, etc.) agnix's CDX-PL validator ignores unknown plugin.json keys (no false positives)
Trust-gate / sandbox / TUI / app-server / realtime / CI PRs Runtime-only, no config-schema impact

Doc bumps

  • knowledge-base/rules.json and crates/agnix-rules/rules.json: bumped verified_on to 2026-04-22 for all 58 CDX-* rules
  • knowledge-base/RESEARCH-TRACKING.md: Codex CLI "Last Reviewed" 2026-02-05 -> 2026-04-22
  • Regenerated website/docs/rules/generated/*.md via scripts/generate-docs-rules.py (forced by docs_website_parity test on any rules.json edit)

ToolVersions

ToolVersions::codex is Option<String> defaulting to None (user-set in .agnix.json), not a hardcoded baseline. Nothing to bump.

Source

https://developers.openai.com/codex/config-schema.json (verified 2026-04-22)

Test plan

  • cargo build --workspace clean
  • cargo test -p agnix-core --lib: 3444 passed (+1 new regression test)
  • cargo test -p agnix-rules --tests: 47 + 4 parity tests pass
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • cargo fmt --all clean
  • Pre-push hook passes
  • CI: Verify Changelog
  • CI: Security Audit
  • CI: Tests (ubuntu, macos, windows)
  • CI: claude-review
  • Address all reviewer comments

Closes #747.

Closes #747.

Triage of openai/codex rust-v0.118.0 -> rust-v0.122.0 (~150 PRs in the
window) surfaced ONE structural change agnix needs to absorb:

The upstream config-schema.json (verified 2026-04-22) gained 8 new
top-level keys that agnix's CDX-CFG-006 (unknown top-level config key)
would false-positive on:

  - experimental_realtime_start_instructions
  - experimental_realtime_ws_startup_context
  - include_apps_instructions
  - include_environment_context
  - include_permissions_instructions
  - marketplaces
  - realtime
  - tool_suggest

Added all 8 to KNOWN_CONFIG_TOP_LEVEL_KEYS in
crates/agnix-core/src/rules/codex.rs. Added a regression test
(test_cdx_cfg_006_codex_v0_122_keys_accepted) that uses every one of
the 8 keys in a single config and asserts zero CDX-CFG-006 diagnostics.

Other inspected upstream changes that need NO agnix changes:
  - MCP server env config (#18085) - env/env_vars already known
  - AGENTS.md discovery refactor (#18035) - file format unchanged
  - Filesystem deny-read globs (#15979, #17740, #18096) - permissions
    already a known top-level key; agnix doesn't drill into sub-objects
  - PermissionRequest hooks (#17563) - agnix doesn't validate Codex hooks
  - models.json removal (#18585) - CDX-CFG-014 is a type-only check, no
    static model list to update
  - All TUI/runtime/refactor/CI PRs - no config-schema impact

Documentation:
  - Bumped verified_on to 2026-04-22 for all 58 CDX-* rules in
    knowledge-base/rules.json (+ synced crates/agnix-rules/rules.json)
  - Bumped RESEARCH-TRACKING.md "Last Reviewed" for Codex CLI from
    2026-02-05 to 2026-04-22
  - Regenerated website/docs/rules/generated/*.md via
    scripts/generate-docs-rules.py (forced by docs_website_parity test)

Verified locally:
  - cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  - cargo test -p agnix-core --lib: 3444 passed (+1 new regression test)
  - cargo test -p agnix-rules --tests: 47 + 4 parity tests pass
  - cargo fmt --all clean
Copilot AI review requested due to automatic review settings April 23, 2026 00:19

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates agnix to support Codex CLI v0.122.0 by adding eight new top-level configuration keys to the validation logic, preventing false-positive 'unknown key' errors. The changes include a new regression test for these keys and a bulk update of the 'verified on' date to 2026-04-22 across the rules database and documentation. I have no feedback to provide.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates agnix’s Codex CLI validation surface to match upstream codex rust-v0.122.0, primarily to avoid false positives on newly added top-level Codex config keys, and refreshes the “verified on” metadata across Codex-related rule documentation.

Changes:

  • Add 8 newly upstream top-level Codex config keys to KNOWN_CONFIG_TOP_LEVEL_KEYS and add a regression test for CDX-CFG-006.
  • Bump verified_on dates for all CDX-* rules in rule metadata and regenerate the website rule docs.
  • Update Codex CLI research tracking date and add a changelog entry for the catch-up.

Reviewed changes

Copilot reviewed 5 out of 63 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/agnix-core/src/rules/codex.rs Adds the 8 new top-level Codex config keys and a regression test intended to prevent CDX-CFG-006 false positives.
crates/agnix-rules/rules.json Bumps verified_on metadata timestamps for CDX-* rules to 2026-04-22.
knowledge-base/rules.json Bumps verified_on metadata timestamps for CDX-* rules to 2026-04-22.
knowledge-base/RESEARCH-TRACKING.md Updates Codex CLI “Last Reviewed” date to 2026-04-22.
website/docs/rules/generated/cdx-000.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-001.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-002.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-003.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-004.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-005.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-006.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-001.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-002.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-003.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-004.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-005.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-006.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-ag-007.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-app-001.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-app-002.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-app-003.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-001.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-002.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-003.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-004.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-005.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-006.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-007.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-008.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-009.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-010.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-011.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-012.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-013.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-014.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-015.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-016.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-017.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-018.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-019.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-020.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-021.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-022.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-023.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-024.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-025.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-026.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-cfg-027.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-001.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-002.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-003.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-004.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-005.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-006.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-007.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-008.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-009.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-010.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-011.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-012.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-013.md Regenerated rule doc with updated Verified On date.
website/docs/rules/generated/cdx-pl-014.md Regenerated rule doc with updated Verified On date.
CHANGELOG.md Adds a “Fixed” entry describing the Codex CLI catch-up and doc metadata bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/agnix-core/src/rules/codex.rs Outdated
Comment on lines +3128 to +3135
let diagnostics = validate_config(toml);
let unknown: Vec<_> = diagnostics
.iter()
.filter(|d| d.rule == "CDX-CFG-006")
.collect();
assert!(
unknown.is_empty(),
"v0.122 top-level keys should not trigger CDX-CFG-006, got: {:?}",
Comment on lines 149 to +154
"experimental_compact_prompt_file",
"experimental_realtime_start_instructions",
"experimental_realtime_ws_backend_prompt",
"experimental_realtime_ws_base_url",
"experimental_realtime_ws_model",
"experimental_realtime_ws_startup_context",
@avifenesh

Copy link
Copy Markdown
Collaborator Author

Per-comment reply table for round 1

# Reviewer File Status Resolution
1 Copilot rules/codex.rs:154 (TOML uses different keys list) Critical catch — Fixed Right — CDX-004 (TOML top-level unknown key) uses `schemas::codex::KNOWN_TOP_LEVEL_KEYS`, not the JSON/YAML `KNOWN_CONFIG_TOP_LEVEL_KEYS` I edited. Without this fix the original PR would have left the false-positive in place for the actual TOML path users hit. Added all 8 keys to `KNOWN_TOP_LEVEL_KEYS` in `crates/agnix-core/src/schemas/codex.rs`. Also added `realtime` and `marketplaces` to `KNOWN_TABLE_KEYS` since the upstream schema allows both inline tables (`realtime = {}`) and section tables (`[realtime]` / `[[marketplaces]]`).
2 Copilot rules/codex.rs:3135 (regression test was vacuous) Fixed Right — `validate_config()` enables CDX-004 by default, and `skip_top_level` (line 1164) makes CDX-CFG-006 silently skip top-level TOML keys when CDX-004 is active. So my test passed regardless of whether the keys were in the allow-list. Renamed and rewrote the test (`test_codex_v0_122_top_level_keys_accepted`) to assert against CDX-004 with two configs: (a) inline values for all 8 keys, (b) section-table variants for `[realtime]` and `[[marketplaces]]`. The test would now fail without the schemas/codex.rs fix from #1.

CHANGELOG updated to mention both files and the CDX-004 primary path. Local verification: 3444 lib tests pass, clippy clean, parity tests pass. Pushing now.

Reviewer feedback (PR #758 round 1, Copilot - both spot-on):

#1: My initial fix only updated KNOWN_CONFIG_TOP_LEVEL_KEYS in
    rules/codex.rs (the JSON/YAML config validation path). But CDX-004
    (the rule that fires for unknown TOML top-level keys, which is the
    primary path users hit for .codex/config.toml) uses a SEPARATE
    allow-list: KNOWN_TOP_LEVEL_KEYS in schemas/codex.rs. Without this
    additional fix, agnix would still false-positive CDX-004 on every
    affected TOML config.

    Added all 8 keys to schemas::codex::KNOWN_TOP_LEVEL_KEYS:
      - experimental_realtime_start_instructions
      - experimental_realtime_ws_startup_context
      - include_apps_instructions
      - include_environment_context
      - include_permissions_instructions
      - marketplaces
      - realtime
      - tool_suggest

    Also added 'realtime' and 'marketplaces' to KNOWN_TABLE_KEYS since
    upstream allows both inline values and TOML tables ([realtime] /
    [[marketplaces]]).

#2: My regression test was vacuous. validate_config() enables CDX-004
    by default, and the skip_top_level branch (rules/codex.rs:1164)
    makes CDX-CFG-006 silently skip top-level TOML keys when CDX-004 is
    active. So my test passed even without any code change.

    Renamed and rewrote (test_codex_v0_122_top_level_keys_accepted) to
    assert against CDX-004 with two configs: (a) inline-value form using
    all 8 keys, (b) section-table form for [realtime] and [[marketplaces]].
    The test now genuinely fails without the schemas/codex.rs fix.

CHANGELOG updated to mention both files and the CDX-004 primary path.

Verified: cargo clippy --workspace --all-targets --all-features
-- -D warnings clean; 3444 lib tests pass; rules.json parity tests pass.
CI's format check (cargo fmt --check) caught two compact-line opportunities
in the rewritten regression test. Mechanical reformat, no behavior change.
Net: -10 LOC. Same lesson as PR #757 commit 30accd2 - run cargo fmt --all
after every code edit, even small ones.
Copilot AI review requested due to automatic review settings April 23, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates agnix’s Codex validators and documentation to align with upstream Codex CLI rust-v0.122.0, preventing false-positive “unknown key” diagnostics when new top-level config keys are used.

Changes:

  • Added 8 newly-introduced Codex top-level config keys to the TOML (CDX-004) and JSON/YAML (CDX-CFG-006) allow-lists.
  • Added a regression test ensuring the new keys (including table forms for realtime / marketplaces) do not trigger CDX-004.
  • Bumped verified_on metadata across Codex rules and regenerated the corresponding website docs.

Reviewed changes

Copilot reviewed 6 out of 64 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/rules/generated/cdx-pl-014.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-013.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-012.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-011.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-010.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-009.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-008.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-007.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-006.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-005.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-004.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-003.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-002.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-pl-001.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-027.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-026.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-025.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-024.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-023.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-022.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-021.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-020.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-019.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-018.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-017.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-016.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-015.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-014.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-013.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-012.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-011.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-010.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-009.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-008.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-007.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-006.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-005.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-004.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-003.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-002.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-cfg-001.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-app-003.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-app-002.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-app-001.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-007.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-006.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-005.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-004.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-003.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-002.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-ag-001.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-006.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-005.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-004.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-003.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-002.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-001.md Update Verified On date for generated rule doc.
website/docs/rules/generated/cdx-000.md Update Verified On date for generated rule doc.
knowledge-base/rules.json Bump verified_on for Codex rules in KB rules dataset.
knowledge-base/RESEARCH-TRACKING.md Update Codex CLI “Last Reviewed” date to 2026-04-22.
crates/agnix-rules/rules.json Bump verified_on for Codex rules in packaged rules dataset.
crates/agnix-core/src/schemas/codex.rs Expand TOML allow-lists (KNOWN_TOP_LEVEL_KEYS, KNOWN_TABLE_KEYS) for new upstream keys.
crates/agnix-core/src/rules/codex.rs Expand JSON/YAML allow-list (KNOWN_CONFIG_TOP_LEVEL_KEYS) and add regression test for CDX-004.
CHANGELOG.md Document the Codex rust-v0.122.0 catch-up and the allow-list/test updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avifenesh
avifenesh merged commit 359c1f1 into main Apr 23, 2026
12 checks passed
@avifenesh
avifenesh deleted the chore/triage-codex-0-122-0 branch April 23, 2026 00:40
avifenesh added a commit that referenced this pull request Apr 23, 2026
…view)

Reviewer feedback (PR #767 round 1):

- Copilot CRITICAL: typed Hook enum still rejected mcp_tool, so even
  with the raw-JSON allow-list fix, CC-HK-012 (schema mismatch) would
  fire on every mcp_tool hook. Added Hook::McpTool variant with tool,
  if, timeout fields (per release notes). Updated all match arms
  (command(), prompt(), type_name(), the per-variant typed-validation
  block in rules/hooks/mod.rs); added is_mcp_tool() for symmetry.

- Copilot: test was vacuous (only checked CC-HK-016 absence; would have
  passed with CC-HK-012 still firing). Strengthened to assert
  diagnostics.is_empty() (zero diagnostics of any rule). Now genuinely
  fails without the typed-enum addition.

- Copilot: comment said 'follows the docs' but docs page hasn't been
  updated yet; reworded to 'follows the release notes' with a caveat
  about the doc gap as of 2026-04-23.

- Gemini MEDIUM: KNOWN_KEYS dedup -> won't fix (project-wide pattern,
  same answer as PR #757/#763).

Plus fmt drift caught by CI (cargo fmt forgotten after round-1 edit;
same lesson as PR #758/#762).
avifenesh added a commit that referenced this pull request Apr 23, 2026
…eview)

Reviewer feedback (PR #768 round 1):
- Gemini/Copilot: regression test only checked CDX-004 (TOML) - the
  JSON/YAML path via CDX-CFG-006 was untested. Split into two tests
  with a new validate_config_json helper.
- Copilot: CHANGELOG grammar 'on any user' -> 'for any config'.
- Gemini KNOWN_KEYS dedup: won't fix (project-wide dual-allow-list
  pattern established in PR #758).
avifenesh added a commit that referenced this pull request Apr 23, 2026
* fix(claude-code): catch up to v2.1.118 (mcp_tool hook type)

Closes #764.

Triage of Claude Code v2.1.117 -> v2.1.118. The release added
`type: "mcp_tool"` so hooks can invoke MCP tools directly. Without
this fix, agnix would false-positive CC-HK-016 (unknown hook type)
on every v2.1.118+ user following the release notes.

Added `"mcp_tool"` to BOTH allow-lists in
crates/agnix-core/src/rules/hooks/helpers.rs:
  - `valid_types` (lines 607, 973): used by CC-HK-016 strict check
  - `known_non_command` (lines 532, 974): used to flag async on
    non-command hook types

Plus a regression test (`test_cc_hk_016_mcp_tool_type_valid`)
asserting `mcp_tool` doesn't trigger CC-HK-016.

Doc gap caveat: as of 2026-04-23 the docs at
code.claude.com/docs/en/hooks only list 4 types (command, prompt,
agent, http). The v2.1.118 release notes explicitly mention mcp_tool
and are authoritative until the docs catch up.

Other v2.1.118 changes need no agnix change:
  - Vim visual mode, /cost+/stats -> /usage, custom themes (UI/CLI)
  - Plugin themes/ directory: agnix's plugin.rs has no strict
    fields check, no false positive
  - DISABLE_UPDATES env var: not a config file
  - wslInheritsWindowsSettings policy key: settings.json field;
    agnix doesn't validate settings.json fields directly
  - autoMode.* '\$defaults' token: settings.json field
  - claude plugin tag (CLI), OAuth/credential bug fixes (runtime)

Documentation:
  - Bumped verified_on to 2026-04-23 for all 25 CC-HK-* rules in
    knowledge-base/rules.json + synced crates/agnix-rules/rules.json
  - Regenerated website/docs/rules/generated/*.md

Verified locally:
  - cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  - cargo test -p agnix-core --lib: passes (+1 new regression test)

* fix: expand mcp_tool to typed Hook enum + strengthen test (round 1 review)

Reviewer feedback (PR #767 round 1):

- Copilot CRITICAL: typed Hook enum still rejected mcp_tool, so even
  with the raw-JSON allow-list fix, CC-HK-012 (schema mismatch) would
  fire on every mcp_tool hook. Added Hook::McpTool variant with tool,
  if, timeout fields (per release notes). Updated all match arms
  (command(), prompt(), type_name(), the per-variant typed-validation
  block in rules/hooks/mod.rs); added is_mcp_tool() for symmetry.

- Copilot: test was vacuous (only checked CC-HK-016 absence; would have
  passed with CC-HK-012 still firing). Strengthened to assert
  diagnostics.is_empty() (zero diagnostics of any rule). Now genuinely
  fails without the typed-enum addition.

- Copilot: comment said 'follows the docs' but docs page hasn't been
  updated yet; reworded to 'follows the release notes' with a caveat
  about the doc gap as of 2026-04-23.

- Gemini MEDIUM: KNOWN_KEYS dedup -> won't fix (project-wide pattern,
  same answer as PR #757/#763).

Plus fmt drift caught by CI (cargo fmt forgotten after round-1 edit;
same lesson as PR #758/#762).
@avifenesh avifenesh mentioned this pull request Apr 23, 2026
7 tasks
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.

Tool release: Codex CLI rust-v0.122.0 (was rust-v0.118.0)

2 participants