Skip to content

agents: agent_poll is declared Risk::ReadOnly but mutates meta.json and deletes mailbox memories #300

Closed

Description

@ajianaz

Summary

AgentPollTool::risk() returns Risk::ReadOnly (crates/tole-core/src/agents.rs:744), but a successful poll calls clean_mailbox (uteke forget of the mailbox namespace) and write_meta (persists mailbox_consumed) (agents.rs:~878-882). jobs.rs:135-143 documents the opposite rule for job_poll: a ReadOnly poll must never mutate — the write-back was removed because 'the risk-tier invariant outweighs the convenience'.

Why it matters

AGENTS.md §6: non-ReadOnly tools must go through an Approver; the risk tier is what the gate and plan mode key on. A tool that writes and deletes while classified ReadOnly bypasses that classification (e.g. it still runs under plan mode).

Expected

Either reclassify agent_poll (Write, with the poll loop's friction handled via the trust preset/allowlist) or move the consume/cleanup side effects out of the poll (e.g. consume at agent_start's completion path / host-side). Decide explicitly and document the tier, with a test pinning it.

Found by

Architecture review 2026-10-07; verified by reading agents.rs and jobs.rs.

Activity

  1. added
    bug
    on Oct 7, 2026
  2. added a commit that references this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions