Skip to content

Let an agent look at its own automations unjudged; gate what acts (H13) - #734

Merged
lydakis merged 2 commits into
mainfrom
claude/wave2-automations-list
Nov 7, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/wave2-automations-list

Conversation

@lydakis

@lydakis lydakis commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What changes

Until now, the gate judged every automations call as a whole. A list or show went to the agent's gate the same way an add did. A sandboxed agent with no reviewer had its lists refused outright. And a list showed every automation in the HOME, whichever agent it woke.

  • What the gate judges: the tool is now declared with steps: true. The tool host answers a look (a call with no add, remove or run) right away. An add, removal or run goes to the agent's gate as one approve_step, the same way a script's calls are judged, and its outcome is reported with step_result. A confined agent with no gate is still refused those calls, as before. The time the gate takes to decide doesn't count against the call's deadline.

  • Scope: an agent's list and show hold only the automations it has a part in. The automation is matched by the agent's id in its store, not by its name:

    • it wakes that agent, including an agent a run started;
    • it sends its answers to that agent;
    • it starts an agent that the caller added.

    Rows now carry by and reply_to_id for this. The person's sonny automation list still lists every automation.

  • What holds afterwards: nothing an agent does through this tool acts outside its sandbox unless its gate judged that specific action first. A look reads only the agent's own rows.

  • Across restart and replay: no new state is stored. The step uses the existing approve_step path, and the rows are read from the trigger files on each call.

remove, run and add are not limited to the caller's own automations. Each is gated as a step that acts, and since the list is limited, an agent no longer learns other agents' automation names from it.

Tool budget

A lead's declared tools must fit within half of DECLARED_BYTES, and main was already 10 bytes under that limit. The new scope wording would have put it 82 bytes over. To make room, the description is trimmed to the same meaning in fewer words. It also drops "(a Mac keeps watch)", since Linux keeps watch through systemd too. The lead's tools are now 7 bytes under the limit.

Tests

  • test_served.py::test_a_sandboxed_agent_no_one_reviews_sees_its_automations_and_adds_none: fails on main, where the list is refused with escalation_refused, and passes with this change.
  • test_served.py::test_an_agent_s_automation_waits_for_its_gate: fails on main, where a run asks no step, and passes with this change. It checks that a look asks nothing and that a run is asked and then denied.
  • trigger::tests::an_agent_s_list_holds_only_the_automations_it_has_a_part_in checks three things:
    • the list holds only the caller's automations;
    • paging is over the caller's own rows;
    • the person's list is not limited.
  • The existing systemd refusal test now declares the tool with steps, the same way Sonny does.
  • Locally: clippy is clean, all 1110 Sonny unit tests pass, and tests.test_served passes.

Cost

  • A look: one fewer inspect round trip, since there is no review check.
  • An action: one more approve_step request and one step_result request.
  • An agent's list: it reads every row, not just one page, at one JSON file per automation. For one HOME this stays small.

Docs

The tool description and docs/SONNY.md are updated. The FEATURES Automations row (H13) goes in through the release PR's row file.

Upgrade notes

None. Running agents get the new declaration the next time Sonny declares its tools again.

🤖 Generated with Claude Code

@lydakis lydakis self-assigned this Nov 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T05:10:06.739148Z e0f3f9f New commits
🔒 Security Review ✅ Completed 2026-11-07T04:58:07.269590Z 973ad01 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47d7c4b9d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/served.rs Resolved
@lydakis
lydakis force-pushed the claude/wave2-automations-list branch from 47d7c4b to bfa1070 Compare November 6, 2026 01:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e274d4b411

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/trigger.rs Resolved
@lydakis
lydakis marked this pull request as draft November 6, 2026 03:28
The automations tool's list and show run as reads do, also for an agent
no one reviews, and hold only the asking agent's own, told by its id in
its store: those that wake it (a run's agent too), answer to it, or
start an agent it added. An add, removal or run is a step its gate
judges, as a script's calls are, and keeps the time the gate took. The
tool's description is trimmed so a lead's tools keep within their share.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE9yc1n2RvseSR8ahH
@lydakis
lydakis force-pushed the claude/wave2-automations-list branch from f77435c to 973ad01 Compare November 7, 2026 04:54
@lydakis
lydakis marked this pull request as ready for review November 7, 2026 04:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 973ad01811

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/SONNY.md Resolved
Comment thread sonny/src/trigger.rs Resolved
The row comes from the definition and state the ownership check read,
not from the files read again, which a replacement in between could
have made another agent's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGE9yc1n2RvseSR8ahH
@lydakis
lydakis merged commit 726f283 into main Nov 7, 2026
5 checks passed
@lydakis
lydakis deleted the claude/wave2-automations-list branch November 7, 2026 05:42
lydakis pushed a commit that referenced this pull request Nov 7, 2026
Picks now read as asks::picks (an option's number), since #776 lets
words in focus answer too: words end quiet, a pick does not. Also
passes trigger::tool its Caller where #776 removes a question's
deadline, which main needs since #734.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEcHQ2BxUW7eMzTs6K
lydakis added a commit that referenced this pull request Nov 7, 2026
#776 called trigger::tool with one argument, but #734 had already
given it a second (&Caller). Each PR was green on its own; together
main does not compile. Pass Caller::default(), as the deadline add
in the same file does.


Claude-Session: https://claude.ai/code/session_013jkdGFG8yDNENZhjTzfLnt

Co-authored-by: Claude <[email protected]>
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.

2 participants