refactor: make tool registry plugin-primary and harden duplicate registration#16
Open
iamthehobbit wants to merge 8 commits intoShinMegamiBoson:mainfrom
Open
refactor: make tool registry plugin-primary and harden duplicate registration#16iamthehobbit wants to merge 8 commits intoShinMegamiBoson:mainfrom
iamthehobbit wants to merge 8 commits intoShinMegamiBoson:mainfrom
Conversation
… and tests New data sources cataloged with fetch scripts and validation tests: - FEC federal campaign finance (API + bulk) - USASpending.gov federal contracts (API) - SAM.gov contractor registrations (API) - SEC EDGAR public company filings (API) - FDIC BankFind institution data (API) - ProPublica Nonprofit Explorer / IRS 990 (API) - Senate lobbying disclosures LD-1/LD-2 (bulk XML) - EPA ECHO enforcement & compliance (API) - OSHA inspection data (API) - OFAC SDN sanctions list (bulk CSV) - ICIJ Offshore Leaks database (bulk CSV) - US Census Bureau ACS (API) All scripts use Python stdlib only. 104 new tests pass (18 skip without API keys or network). Wiki index updated with new categories.
- Replace _ThinkingDisplay with _ActivityDisplay supporting three modes: thinking (cyan), streaming response (green), tool execution (yellow) - Auto-transition from thinking→streaming on first text delta - Show step counter (Step N/max) in activity spinner - Show tool name and key argument during tool execution - Add engine cancellation via threading.Event (_cancel flag) - Run agent in background thread so user can type next question - Queue typed input during agent execution (FIFO) - ESC key binding cancels the running agent - Add 13 tests covering ActivityDisplay, cancellation, and queuing
Extends ToolResult with optional ImageData payload and adds a read_image tool that reads PNG/JPEG/GIF/WebP files, base64-encodes them, and passes them through to the model layer in provider-specific formats (Anthropic content blocks, OpenAI data URI in user messages).
Add 5 reusable analysis scripts: - quickstart_investigation.py: starter template for investigations - scripts/entity_resolution.py: entity linking pipeline - scripts/cross_link_analysis.py: cross-referencing engine - scripts/build_findings_json.py: report synthesis utility - scripts/timing_analysis.py: statistical timing correlation Fix TUI flicker by making _ActivityDisplay a Rich renderable (__rich__ protocol) so Live's 8fps auto-refresh polls state instead of feed() forcing update() on every token delta.
Tell the agent about replay.jsonl, events.jsonl, and state.json in its session directory so it can read its own prior transcripts and recall earlier work within a session.
…ape sequences Root cause: prompt_toolkit's patch_stdout() wraps sys.stdout with StdoutProxy which corrupts Rich's ANSI escape sequences — replacing ESC bytes (0x1b) with '?' (0x3f). This caused raw escape codes like ?[2K?[1A?[2K to appear as visible text instead of being interpreted by the terminal. Fix: scope patch_stdout() to only wrap session.prompt(), not the entire main loop. During agent execution, Rich's Live writes directly to the real stdout with correct escape sequences. Also remove the secondary prompt loop (which compounded the issue) and switch cancellation from ESC to Ctrl+C. Verified via PTY test: 36 correct ESC sequences, 0 corrupted (was 0/16).
This was referenced Feb 23, 2026
Author
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
This PR completes the built-in plugin migration and makes plugin/registry definitions the primary source for tool export (with compatibility fallback retained during transition).
It also hardens duplicate plugin registration behavior.
What’s included
list_files)Tests Added / Coverage
tests/test_tool_registry.pytests/test_builtin_tool_plugins.pytests/test_tool_defs.pytests/test_engine.pyWhy
This makes the tool system reliably extensible and safer for future plugin-based integrations.
Risk / compatibility