fix(cli): handle tool: wrapper key in agents tool add YAML config #1471 (#1498)
CI / lint (push) Failing after 20s
CI / build (push) Successful in 16s
CI / typecheck (push) Failing after 56s
CI / security (push) Failing after 55s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / helm (push) Successful in 25s
CI / unit_tests (push) Failing after 1m54s
CI / docker (push) Has been skipped
CI / quality (push) Successful in 3m41s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 14s
CI / lint (pull_request) Failing after 19s
CI / helm (pull_request) Successful in 23s
CI / security (pull_request) Failing after 52s
CI / typecheck (pull_request) Failing after 57s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m54s
CI / docker (pull_request) Has been skipped
CI / benchmark-publish (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / status-check (push) Has been cancelled
CI / quality (pull_request) Successful in 3m50s
CI / e2e_tests (pull_request) Failing after 14m18s
CI / integration_tests (pull_request) Failing after 21m41s
CI / status-check (pull_request) Failing after 3s

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
This commit was merged in pull request #1498.
This commit is contained in:
2026-04-02 19:33:36 +00:00
committed by Forgejo
parent 71177c6e1a
commit 0022c9c035
+9
View File
@@ -241,6 +241,15 @@ def add(
raw = config.read_text(encoding="utf-8")
config_dict = yaml.safe_load(raw)
# Handle spec-compliant 'tool:' wrapper key format
# If the YAML has a top-level 'tool:' key, extract its contents
if isinstance(config_dict, dict) and 'tool' in config_dict:
config_dict = config_dict['tool']
# Ignore 'cleveragents:' version header if present
if isinstance(config_dict, dict) and 'cleveragents' in config_dict:
del config_dict['cleveragents']
if not isinstance(config_dict, dict):
raise ValueError("YAML config must be a mapping")