Skip to content

Prototype Tinfoil-backed Responses web search#172

Draft
AnthonyRonning wants to merge 6 commits into
masterfrom
feat/tinfoil-websearch-prototype
Draft

Prototype Tinfoil-backed Responses web search#172
AnthonyRonning wants to merge 6 commits into
masterfrom
feat/tinfoil-websearch-prototype

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • wire the local Responses web_search tool to Tinfoil's MCP search endpoint while keeping the existing local agent loop
  • add a small Tinfoil web search client that reuses TINFOIL_API_KEY, handles the SSE-ish MCP envelope, and normalizes the returned payload
  • prefer the Tinfoil-backed search path when configured, while keeping Brave as the fallback

Validation

  • cargo test --manifest-path /Users/tony/Dev/OpenSecret/opensecret/Cargo.toml

Notes

  • draft save-point for experimentation
  • this branch intentionally stacks on top of the in-flight Responses tool-calling work and can be rebased later
  • only the search path is wired today; fetch/tool formatting follow-up can happen in a later pass

AnthonyRonning and others added 6 commits April 15, 2026 00:21
Remove the unused Kagi client and secret loading so Responses search behavior matches our live provider setup.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Replace ad-hoc reasoning flags with a ReasoningState enum and small
helpers in stream_one_assistant_turn so the per-turn lifecycle is
easier to reason about. Trailing assistant text after tool_calls is
now logged and dropped instead of aborting the response, and an
assistant turn that produces no content emits an empty placeholder
message so the stream still closes cleanly.

Drop the dead message_id argument from storage_task and align the
finish_reason on tool-call MessageDone with the OpenAI 'tool_calls'
spelling. On ResponseDone, defensively call mark_pending_items_incomplete
and log at error level if any pending items remain so the sender
invariant violation is loud and the DB never holds in_progress
stragglers.

Add multi-turn tool prompt builder tests covering single tool turns,
multiple consecutive tool turns, system-prompt + tool turns, and
truncation that preserves the most recent tool turn.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Wire the local Responses web_search tool to Tinfoil's MCP search endpoint so we can exercise the new agent loop without adopting provider-side web search flows yet.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5e3d889f-dbf1-4465-95a3-90e97e26cc8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tinfoil-websearch-prototype

Comment @coderabbitai help to get the list of available commands and usage tips.

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