Skip to content

0.2.35: Route computer events to one conversation per computer - #94

Open
alex-w-99 wants to merge 2 commits into
mainfrom
feat/computers-agent-ownership
Open

alex-w-99 wants to merge 2 commits into
mainfrom
feat/computers-agent-ownership

Conversation

@alex-w-99

@alex-w-99 alex-w-99 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Executive Summary

Route computer.* lifecycle events into one Claude session per computer and bump the bridge to 0.2.35.

  • computer.created, started, stopped, paused, resumed, failed and deleted each run one turn in a computer:<computer_id> session, from a webhook subscription or a hosted delivery.
  • Repeat events for a computer share history and never enter a contact's session; the turn's text reply is not sent anywhere.
  • A redelivered event (same event id) runs once.

Description

The server now emits computer.* webhook events with data.computer_id, identity_id, agent_handle, state and an optional failure_category. InkboxGateway recognises the computer. prefix as an Inkbox event shape (so these are no longer ignored or treated as external events), dedups them on the envelope id, and dispatches them to _on_computer_event. That builds a short prompt (event, computer id, state, failure category, event time, with bracket and whitespace sanitising) and runs it through the existing external-turn path in session computer:<computer_id> with a directive that the turn is a lifecycle notice and its reply is not delivered. The outbound send path drops text for computer: sessions the same way it already does for external: sessions. A managed hosted delivery waits for the turn before it settles.

Version bumped in pyproject.toml, inkbox_claude/__init__.py and uv.lock; CHANGELOG and README updated.

Reason

Computer events have no contact, so without a dedicated session key they would be dropped or mixed into unrelated conversations; one session per computer gives the agent a coherent history for each machine.

Decisions

  • Session key: Keyed by computer_id only, because the events carry no contact and every event about one computer should share context.
  • Reply handling: The turn's text reply is dropped, because there is no channel behind a computer; the agent follows up with its tools.
  • Dedup: Computer events dedup on the event id like received messages, so a webhook retry does not run a second turn.
  • Subscription: The bridge does not subscribe to computer.* itself; a hosted agent receives the events selected in its triggers, and self-hosted users opt in through their own subscription.

Testing

  • Signed computer.failed webhook to /webhook with data.computer_id: one turn in session computer:<id>; the prompt names the event, computer, state and failure category; nothing is sent to any contact.
  • A second event for the same computer reuses that session; an event for another computer gets its own.
  • Resending the same event id: deduped, no second turn. An event with no data.computer_id: 200 with ignored: no-computer-id.
  • Hosted delivery of a computer.* event: the delivery settles after the turn finishes.
  • uv run pytest -q --ignore=tests/contract --ignore=tests/live: 1992 passed (includes the new tests/test_computer_events.py).
  • uv run pytest -q tests/contract: 12 passed, 1 skipped.
  • Live workflows (live-*.yml) not run.

Related PRs

None.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@alex-w-99
alex-w-99 marked this pull request as ready for review December 5, 2026 02:09
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