fix: v0.7.3 — agent create kb_ref kwarg leak; log shell exceptions - #19
Merged
Merged
Conversation
… file - Filter `answers` to declared `spec.params` before `spec.callback(**answers)` so picker scratch state (e.g. `kb_ref` from the KB→index cascade) no longer leaks through as an unexpected kwarg. Fixes `TypeError: agent_create() got an unexpected keyword argument 'kb_ref'` regressed in v0.7.2. - Log shell command + workflow exceptions via `pais.logging.get_logger` so tracebacks land in `~/.pais/logs/pais.log` and are recoverable via `pais doctor` / `pais logs tail`. - Bump to 0.7.3; CHANGELOG entry. 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
TypeError: agent_create() got an unexpected keyword argument 'kb_ref'— the KB→index picker cascade added in v0.7.2 stashes the picked KB intoPickerContext.answers["kb_ref"], but_dispatchthen fed the fullanswersdict throughspec.callback(**answers)— andagent_createdeclares nokb_refparameter. The dispatcher now filtersanswersto declaredspec.paramsnames before invoking. Any future picker that stashes side-channel state stays contained.~/.pais/logs/pais.log— previously the top-level handlers inenter_interactiveonly printederror: …to the console.pais doctor/pais logs tailcouldn't recover the traceback. Both the flat-menu dispatch path and the workflow path now emitshell.command_crashed/shell.workflow_crashed(with full traceback) via the existing structlog logger before printing.Test plan
uv run ruff check && uv run ruff format --checkuv run mypy srcuv run pytest -q— 384 passed (was 381 pre-fix; +2 regressions, +1 logging test)test_dispatch_filters_picker_scratch_keys— picker stashing a bogus key doesn't crash a strict callback.test_agent_create_flow_picks_kb_then_indexnow assertskb_ref not in captured.test_shell_logs_command_exceptions—shell.command_crashedevent is emitted when dispatched command raises.pais→agent create→ pick model → pick KB → pick index → Go → agent created, no TypeError.🤖 Generated with Claude Code