Skip to content

toolprune: only record Codex capabilities whose TOML keys were inserted - #154

Merged
Saksham Uboweja (SakshamUboweja) merged 1 commit into
microsoft:mainfrom
TejasLamba2006:fix/codex-apply-user-keys
Nov 8, 2026
Merged

Saksham Uboweja (SakshamUboweja) merged 1 commit into
microsoft:mainfrom
TejasLamba2006:fix/codex-apply-user-keys

Conversation

@TejasLamba2006

Copy link
Copy Markdown
Contributor

Found while reading _apply_codex in tokeneconomizer/plugin/denylist.py.

_toml_insert returns (text, did) and leaves text untouched (did=False) when a key was already set by the user in .codex/config.toml or when the target table is an inline table (features = { ... }). _apply_codex ignored that boolean (text, _ = _toml_insert(...)) and unconditionally appended cap to added, rewriting .codex/config.toml and recording the capability in untool_applied.json even when none of its keys were inserted.

This checks whether at least one toggle for cap was inserted before adding cap to added.

@SakshamUboweja
Saksham Uboweja (SakshamUboweja) merged commit 615c1d7 into microsoft:main Nov 8, 2026
10 checks passed
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.

2 participants