Repository navigation
feat: add opt-in Attention context and browser tools - #164
Merged
Merged
Conversation
Checkpoint of the reviewed Attention V1 agent work, committed as is so the review fixes that follow are separate, readable commits. - Explicit attention_* read tools that project Host replies into the compact wippy.attention.model.v1 result. - wippy.agent.traits:attention with its before_execute read guard and the private attention_read_receipt tool. - Tool caller grants Attention runtime authority per call and strips inherited runtime fields from tool and session context. - ATTENTION.md documents the tools, result format and read limits.
string.find and process.unlisten return two values. Passed straight into test.not_nil, test.is_nil or test.is_true, the second value lands in the message argument and fails the type check. Parentheses keep only the first value. wippy lint --level error now reports no issues.
The read guard replaced a refused call's arguments with
{reason, original_registry_id, invalid}. Session persists those
arguments as the assistant's own function call, so the model lost what
it actually sent.
- The guard now keeps call.arguments and passes the refusal as
context.attention_refusal, merged with any existing tool context.
Tool context survives validate() and reaches the execution context.
- attention_read_receipt reads the refusal with ctx.get and ignores its
arguments. Its input_schema accepts any object.
- The receipt result still carries invalid, so repair budget counting
from history is unchanged.
- Tests assert unchanged arguments and the context refusal, and the
caller test runs the real receipt tool with the execution context,
including invalid-call repair budget counting.
attention_inspect accepted any operation and arguments and returned the raw Host reply. It was not in the Attention trait, but any agent could list it and get read authority outside the explicit read tools and their limits. - Remove its registry entry, its runtime authority in the tool caller and its handler and 32 KiB raw-result path in ui_action_tool. - attention_read.is_read still recognizes the ID so stored history can be interpreted; the guard turns any new call into a refusal receipt. - Process tests now use attention_get_tree and attention_find_semantic. The byte-limit test checks the 8 KiB compact projection instead of the removed raw bound. New tests cover the missing registry entry, the missing authority and the guard refusal. - ATTENTION.md says the tool was removed and what replaces it.
ui_action_test_broker has meta type test-helper. The module's wippy.yaml excludes only type test and scope dev, so the broker shipped with wippy/agent. Mark it scope: dev, the convention used in llm and views. The test app loads src/agent from source and does not apply the publish excludes, so the broker-backed process tests still find it. Verified with wippy publish --dry-run (pack only): 49.4 KB before, 48.1 KB with scope: dev, and 48.1 KB for a control that changed the broker to type test instead. Agent tests 344/344, lint clean.
The trait prompt opened with "Return only the requested fields." It goes into the system prompt of every agent with the Attention trait and was not limited to Attention answers, so it could conflict with the agent's own answer instructions. The sentence now reads "When answering from Attention tool results, report only the fields the user asked about." The rest of the paragraph is unchanged.
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.
Adds optional Attention support so an agent can answer questions such as "what am I pointing at?" or "find the Save button" from current browser evidence. Add
wippy.agent.traits:attentionto enable the tools. Live browser operations also require a compatible Session module and Web Host.attention_context_enabledthrough the existing session-open flow.Automatic context is off by default. Capture requires user approval and prepares a removable file for a later Send. Message delivery retains the existing request correlation and receipt.
V1 tools are selected through agent declarations and traits. An agent using
wippy.agent.tools:*also receives Attention tools through wildcard expansion. Strict isolation for wildcard agents, current page URL/path and recursive route-owner reporting are deferred to V2.Validation: all required Framework CI checks pass. With runner
0.3.45a, Agent 401, LLM 1,609, Relay 19 and Facade 77 tests pass, along with their lint checks. Four focused Attention browser cases pass. The ordinary-chat smoke also passes uploads, agent/model switching, Stop recovery and history reload.Release LLM
0.5.5, Agent0.5.3and Relay0.3.16before Sessions0.6.7. Publish Facade later, after Host1.0.61CDN deployment and its consumer smoke gates.