Skip to content

Add query_hand_ephemeral one-shot hand query#1250

Open
marcosvillegasmadrigal wants to merge 1 commit into
RightNow-AI:dependabot/cargo/tauri-plugin-updater-2.10.1from
marcosvillegasmadrigal:dependabot/cargo/tauri-plugin-updater-2.10.1
Open

Add query_hand_ephemeral one-shot hand query#1250
marcosvillegasmadrigal wants to merge 1 commit into
RightNow-AI:dependabot/cargo/tauri-plugin-updater-2.10.1from
marcosvillegasmadrigal:dependabot/cargo/tauri-plugin-updater-2.10.1

Conversation

@marcosvillegasmadrigal

Copy link
Copy Markdown

Introduce a new KernelHandle method query_hand_ephemeral for synchronous one-shot hand queries that return an LLM response wrapped as external untrusted content (hand://...). Implement the method on OpenFangKernel; it clones the agent manifest, applies a transient max_tokens override, disables tools, calls the resolved LLM driver with a wall-clock timeout, and guarantees no session or persistence side effects. Make default_driver test-swappable by changing it to RwLock<Arc> and add a #[cfg(test)] set_test_default_driver helper. Update resolve_driver fallback to read the locked default driver. Add extensive tests and test drivers (RecordingDriver, SleepDriver) to verify wrapping, timeout, max_tokens behavior, and zero-persistence guarantees. Add default trait impl in runtime that returns not supported for backwards compatibility.

Summary

Changes

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

Introduce a new KernelHandle method query_hand_ephemeral for synchronous one-shot hand queries that return an LLM response wrapped as external untrusted content (hand://...). Implement the method on OpenFangKernel; it clones the agent manifest, applies a transient max_tokens override, disables tools, calls the resolved LLM driver with a wall-clock timeout, and guarantees no session or persistence side effects. Make default_driver test-swappable by changing it to RwLock<Arc<dyn LlmDriver>> and add a #[cfg(test)] set_test_default_driver helper. Update resolve_driver fallback to read the locked default driver. Add extensive tests and test drivers (RecordingDriver, SleepDriver) to verify wrapping, timeout, max_tokens behavior, and zero-persistence guarantees. Add default trait impl in runtime that returns not supported for backwards compatibility.

Signed-off-by: Marcos Alberto Villegas Madrigal <marcosvillegasmadrigal@gmail.com>
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