Skip to content

feat(mcp): agents create and complete tasks and set Remind Me under ;write - #84

Merged
bketelsen merged 2 commits into
mainfrom
agent-pim/writes
Oct 19, 2026
Merged

bketelsen merged 2 commits into
mainfrom
agent-pim/writes

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Plan 0012's writes, and the end of its build (M8.5, ADR-0042). Agents with ;write can create and complete tasks and set Remind Me. Nothing writes an event.

This PR is based on #83, which is based on #82, and contains both PRs' commits. Merge #82, then #83, then this one. Its own commit is 62392da.

What changes

The IDL opens tasks.create, tasks.update and message.remind to agents, with scope: write.

The engine keeps these writes in the scope:

  • another account's task list, parent task, task or message is notFound;
  • tasks.create without a list picks the default list of the first account the scope reaches. The test checks this under account=B, with account A first.

New write tools, all destructiveHint false and offered only with ;write:

Tool What it does Limits
create_task adds a task title 1 to 1,024 bytes, more than spaces; notes up to 32 KiB; due YYYY-MM-DD; list_id optional
complete_task completes a task; completed: false reopens it
remind_me sets Remind Me on a message, or clears it with no at at is RFC 3339 with an offset, after now and at most 365 days ahead
  • What's left closed: no event write is reachable under any scope. feat(mcp): agents read calendars, tasks and contacts in their scope #82's test already checks that calendar.* writes return methodNotFound under account=*;write;send.
  • Instructions: the server's instructions per scope now name these tools, and say the token can't change the calendar.
  • Docs:
    • specs/lodge-app.md: the PIM section is now marked built, the Methods and callers table includes these methods, and ;write's meaning is updated;
    • plan 0012: Phases 1 to 4 are built, with evidence, and Phase 5's live check waits on lodge's agent socket;
    • the roadmap row and AGENTS.md's status say the same.

Tests

internal/lodge/mcp_pim_write_test.go, through kittest and the SDK client:

  • Engine: on agents' connections, without ;write all three methods return methodNotFound; under account=B;write, B's own data works and A's list, parent task, task and message are notFound, and A's task and message are left unchanged.
  • Tools: not offered without ;write. Under ;write:
    • create_task "Call Iris back", due Friday, lands in Tasks A and shows in list_tasks;
    • complete_task completes it and reopens it;
    • remind_me sets a reminder and clears it;
    • each one errors on the other account's data.
  • Limits, at the value and one past it:
    • title of 1 and 1,024 bytes passes; empty, spaces only and 1,025 bytes fail;
    • notes of 32 KiB passes, one byte more fails;
    • remind_me 365 days ahead passes; one second past that, now, a second ago, and a time with no offset all fail.

The test seed now stores real VTODO sources, so updates patch them as they would on a server. It also gives the seed a fixed clock, so reminder times don't drift with the real date.

Gates

On this branch, which contains the whole chain:

  • make check and make build-windows pass;
  • in nsl, make ui-check (1,327 tests), make app-test and make app-build pass.

🤖 Generated with Claude Code

bketelsen and others added 2 commits October 19, 2026 16:24
Plan 0012's Phase 3 (ADR-0042). thread.awaitingReply answers the
threads waiting on the user: the newest message, past drafts and what is
only in Drafts, Trash or Junk, is from someone else to one of its
account's identities in To, from no list or no-reply sender, not
answered, muted or blocked, and in an inbox. thread.awaitingOthers
answers the user's own mail with no reply since. Both put VIPs first,
then the newest, take a window of days, and keep an agent to its scope.

store.NewestMessages finds each thread's newest eligible message in one
query over the window. mailctl waiting prints both. /mcp/mail gains
threads_awaiting_reply and threads_awaiting_others, with time_zone for
their dates.

A test per rule and boundary, a Gmail INBOX label among them; the tools
and their limits through kittest and the SDK client. On 50,000 mailgen
messages each method answers in p95 under 70 ms at 90 days.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…write

Plan 0012's writes (ADR-0042). tasks.create, tasks.update and
message.remind open to agents whose scope has ;write. The engine keeps
them to the scope: another account's task list, parent task, task or
message is notFound, and a new task without a list goes to the default
list of the first account the scope reaches.

/mcp/mail gains create_task, complete_task (which reopens with
completed false) and remind_me, with their limits: a title of 1 to
1,024 bytes, notes up to 32 KiB, a reminder after now and within 365
days. No tool writes an event, under any scope; the server's
instructions say so.

The spec's PIM section, plan 0012, the roadmap and AGENTS.md now say
Phases 1 to 4 are built; Phase 5's live check waits on lodge's agent
socket.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bketelsen
bketelsen merged commit 08532ef into main Oct 19, 2026
6 checks passed
@bketelsen
bketelsen deleted the agent-pim/writes branch October 19, 2026 23:04
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