Skip to content

AI spam#3536

Closed
popsiclelmlm wants to merge 1 commit into
pallets:mainfrom
popsiclelmlm:avoid-completion-side-effects
Closed

AI spam#3536
popsiclelmlm wants to merge 1 commit into
pallets:mainfrom
popsiclelmlm:avoid-completion-side-effects

Conversation

@popsiclelmlm
Copy link
Copy Markdown

Fixes #2614.

This keeps resilient parsing from evaluating parameter defaults, default maps, or callbacks while shell completion resolves the command context. That matches the documented behavior for resilient parsing and avoids slow or side-effectful default/callback code during tab completion.

Changes:

  • skip default/default_map lookup while resilient parsing is active
  • skip parameter callbacks while resilient parsing is active, including missing boolean flags
  • add shell completion regression tests
  • add a changelog entry

Tests:

  • uv run --locked --no-default-groups --group tests pytest tests/test_shell_completion.py -q
  • uv run --locked --no-default-groups --group tests pytest tests/test_shell_completion.py tests/test_options.py tests/test_defaults.py tests/test_context.py -q
  • uv run --locked --no-default-groups --group tests pytest -q
  • git diff --check

@davidism davidism closed this May 30, 2026
@davidism davidism changed the title Avoid side effects during shell completion AI spam May 30, 2026
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.

Click evaluates default callbacks during tab-completion

2 participants