Skip to content

fix: v0.7.2 — agent create KB→index picker cascade; hidden-param OptionInfo leak - #18

Merged
dshahnaz merged 1 commit into
mainfrom
fix/agent-create-kb-index-cascade
Apr 17, 2026
Merged

dshahnaz merged 1 commit into
mainfrom
fix/agent-create-kb-index-cascade

Conversation

@dshahnaz

Copy link
Copy Markdown
Owner

Summary

  • pais agent create KB→index picker cascade. The interactive shell used to drop users to ? type the index alias or UUID: because agent create has no kb_ref parameter to pre-populate PickerContext.answers. pick_index / pick_or_create_index now cascade into pick_kb / pick_or_create_kb when no KB is in scope, stash the pick, then list indexes under it. ← back and + create new propagate cleanly. Applied inside the pickers, so any future command that binds an index picker without a preceding KB param inherits the cascade.
  • Hidden params no longer leak typer.OptionInfo into callbacks. The dispatcher used to continue past hidden=True params, so spec.callback(**answers) fell back to the function's declared default — the raw typer.Option(None, …) wrapper. In agent create, if kb_search_tool: was always truthy on that OptionInfo and crashed ToolLink(tool_id=<OptionInfo>) with a pydantic validation error. The dispatcher now injects the hidden param's resolved default into answers (same pattern as destructive yes).

Test plan

  • uv run pytest -q — 382 passed (was 378; +4 tests)
  • uv run ruff check — clean
  • uv run ruff format --check — clean
  • uv run mypy src — clean on 81 files
  • Manual against live PAIS: pais agent create shows KB picker → index picker (no raw text prompt) and does not crash when --kb-search-tool is absent

🤖 Generated with Claude Code

…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>
@dshahnaz
dshahnaz merged commit c69ef4e into main Apr 17, 2026
3 checks passed
@dshahnaz
dshahnaz deleted the fix/agent-create-kb-index-cascade branch April 17, 2026 13:58
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.

1 participant