Skip to content

.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.

Issue description

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("")).

Issue Context

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.

Fix Focus Areas

  • packages/sdk/langs/python/superdoc/tools_api.py[188-209]

Suggested fix

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'.



Clone this wiki locally