-
Notifications
You must be signed in to change notification settings - Fork 194
.pr_agent_accepted_suggestions
qodo-merge-bot edited this page Jul 15, 2026
·
1 revision
| PR 3827 (2026-07-14) |
[correctness] Empty base defaults
Empty base defaults
In Python `create_agent_toolkit()`'s custom-actions path, `base_id` is derived using truthiness (`or`), so an explicit empty-string `base`/`preset` silently falls back to `'core'` instead of failing fast. This diverges from Node’s nullish-coalescing behavior and can run the wrong preset without surfacing configuration errors.Python create_agent_toolkit() computes base_id with or, which treats "" as missing and silently defaults to 'core'. This hides misconfiguration and diverges from Node’s ?? semantics (where "" is preserved and should fail via get_preset("")).
Callers can supply base/preset explicitly when using the one-call actions path. If they accidentally pass an empty string, Python currently selects 'core' instead of erroring.
- packages/sdk/langs/python/superdoc/tools_api.py[188-209]
Replace:
base_id = input.get('base') or input.get('preset') or 'core'with a None-aware selection that does not treat "" as absent, e.g.:
base_arg = input.get('base')
preset_arg = input.get('preset')
base_id = base_arg if base_arg is not None else (preset_arg if preset_arg is not None else 'core')Optionally add/adjust a unit test to assert { "base": "" } (or { "preset": "" }) raises PRESET_NOT_FOUND (or the equivalent failure) rather than defaulting to 'core'.