Skip to content

feat: thinking-control content type (convos.org/thinking-control:1.0) - #101

Draft
yewreeka wants to merge 1 commit into
mainfrom
feat/thinking-control-content-type
Draft

feat: thinking-control content type (convos.org/thinking-control:1.0)#101
yewreeka wants to merge 1 commit into
mainfrom
feat/thinking-control-content-type

Conversation

@yewreeka

@yewreeka yewreeka commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the thinking-control content type, convos.org/thinking-control:1.0 — the user-to-agent counterpart of convos.org/thinking:1.0. Where thinking is an agent narrating its own session, a thinking-control message is any conversation member asking the agent to stop that session or resume it.

Payload:

{ "action": "stop" | "resume", "targetMessageId": "<anchor message id>", "agentInboxId": "<agent inbox id>" }
  • Keyed by (agentInboxId, targetMessageId) — the same session key the thinking events use. agentInboxId disambiguates when two agents think about the same message.
  • Silent like thinking: no fallback text, shouldPush false, never rendered as a chat row.
  • Controls are requests, not state transitions — the agent acknowledges via its own thinking events.

Changes

  • src/utils/thinkingControl.ts: ThinkingControlCodec, ContentTypeThinkingControl, isThinkingControlMessage, getThinkingControlContent, ThinkingControl/ThinkingControlAction types — mirrors thinking.ts structure exactly. Subpath import @xmtp/convos-cli/utils/thinkingControl works via the existing ./utils/* wildcard export.
  • src/utils/client.ts: codec registered in buildClient.
  • src/index.ts: root exports.
  • agent serve: inbound thinking-control messages emit a thinking_control event (action, targetMessageId, agentInboxId); new thinking-control stdin command sends them.
  • test/utils/thinkingControl.test.ts: mirrors the thinking codec suite.
  • Changeset: minor bump.

Context

Testing

  • pnpm typecheck clean.
  • pnpm test: 511 passed; the 3 failures (test/commands/identity.test.ts, test/commands/init.test.ts) fail identically on clean origin/main in this environment (pre-existing, unrelated).

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Note

Add thinking-control content type for agent stop/resume signaling

  • Introduces a new convos.org/thinking-control:1.0 content type implemented in src/utils/thinkingControl.ts with a ThinkingControlCodec that encodes/decodes stop and resume actions targeting a specific message and agent inbox.
  • Registers the codec in buildClient and exports all related types and helpers from the package's public API.
  • Extends agent serve to classify inbound thinking-control messages as a distinct event type and to accept a new thinking-control stdin command with required action, targetMessageId, and agentInboxId fields.
  • Messages are sent silently (no push notification, no fallback content); invalid payloads emit errors rather than throwing.

Macroscope summarized 2c874c6.

User-to-agent stop/resume requests for thinking sessions, the counterpart
of convos.org/thinking:1.0. Payload: { action: "stop" | "resume",
targetMessageId, agentInboxId }, keyed to the same (agentInboxId,
targetMessageId) session key the thinking events use. Silent like
thinking: no fallback, shouldPush false.

- ThinkingControlCodec + isThinkingControlMessage/getThinkingControlContent
  in src/utils/thinkingControl.ts, registered in buildClient and exported
  from the package root (subpath import works via the ./utils/* wildcard).
- agent serve: inbound messages emit a thinking_control event; a new
  thinking-control stdin command sends them.
- Mirrored test suite in test/utils/thinkingControl.test.ts.

Sender side (Convos iOS) is xmtplabs/convos-ios#1053; the behavior plan
is xmtplabs/convos-assistants#2105.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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