fix: v0.7.2 — agent create KB→index picker cascade; hidden-param OptionInfo leak - #18
Merged
Merged
Conversation
…onInfo leak Two interactive-shell fixes driven by a live `pais agent create` report: - `pick_index` / `pick_or_create_index` now cascade into `pick_kb` / `pick_or_create_kb` when no KB is in scope, instead of dropping the user to `? type the index alias or UUID:`. The fix lives inside the pickers, so any future command that binds an index picker without a preceding KB parameter inherits the cascade automatically. - Hidden params (`--kb-search-tool`) were skipped entirely by the dispatcher, which left `spec.callback(**answers)` falling back to the function's declared default — the raw `typer.Option(None, …)` `OptionInfo` wrapper. That tripped `if kb_search_tool:` (truthy) and crashed `ToolLink` with `tool_id: input_type=OptionInfo`. The dispatcher now injects the hidden param's declared default into `answers` (matching the destructive-`yes` pattern). Coverage: +4 tests (3 unit + 1 dispatch integration) — 382 passed total. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pais agent createKB→index picker cascade. The interactive shell used to drop users to? type the index alias or UUID:becauseagent createhas nokb_refparameter to pre-populatePickerContext.answers.pick_index/pick_or_create_indexnow cascade intopick_kb/pick_or_create_kbwhen no KB is in scope, stash the pick, then list indexes under it.← backand+ create newpropagate cleanly. Applied inside the pickers, so any future command that binds an index picker without a preceding KB param inherits the cascade.typer.OptionInfointo callbacks. The dispatcher used tocontinuepasthidden=Trueparams, sospec.callback(**answers)fell back to the function's declared default — the rawtyper.Option(None, …)wrapper. Inagent create,if kb_search_tool:was always truthy on that OptionInfo and crashedToolLink(tool_id=<OptionInfo>)with a pydantic validation error. The dispatcher now injects the hidden param's resolved default intoanswers(same pattern as destructiveyes).Test plan
uv run pytest -q— 382 passed (was 378; +4 tests)uv run ruff check— cleanuv run ruff format --check— cleanuv run mypy src— clean on 81 filespais agent createshows KB picker → index picker (no raw text prompt) and does not crash when--kb-search-toolis absent🤖 Generated with Claude Code