Skip to content

agent 0.10.0, sdk 2.4.0: types for openQuestion, outcome-event question and labels, sourceLabels - #853

Draft
ZIJ wants to merge 3 commits into
mainfrom
feat/types-open-question-labels
Draft

ZIJ wants to merge 3 commits into
mainfrom
feat/types-open-question-labels

Conversation

@ZIJ

@ZIJ ZIJ commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What the platform sends now

The managed-agents platform now sends several fields that the published TypeScript types do not name. Today an agent or application can read them only through a cast.

  • A Slack question no longer holds the thread. If someone types a message while a question the agent asked is still open, that message runs right away as an ordinary turn. Its channel input carries openQuestion: { id, text, options }, which is the pending question. A question that closes this way has the reason superseded.
  • Outcome events (delivered by event subscriptions, source: "event") now include:
    • outcome: "question" when the completed turn ended by asking.
    • question: { id, text, options }, which is what that turn asked.
    • labels, which are the source session's labels.
    • result.text, which is now the last message of the completed turn that wrote text.
  • Event subscriptions accept and return sourceLabels: 1 to 8 label pairs that the source session must carry when the turn is accepted. They use the same key and value rules as session labels.

Changes

@opencomputer/agent (agent/src/index.ts)

  • The channel variant of AgentInput gains openQuestion?: Question.
  • OutcomeEvent gains outcome?, question? and labels?.
  • Three new exported types: Question ({ id, text, options }), TurnOutcome ("question") and SessionLabels.
  • The doc comments on result, HeldInput and useTool("ask") now describe how Slack behaves.

@opencomputer/sdk (sdks/typescript/src/agents/)

  • CreateEventSubscriptionBody and EventSubscription gain sourceLabels?. The response shape checks it as a string map.
  • OutcomeEvent gains:
    • outcome?: TurnOutcome
    • question?: Omit<SessionQuestion, "askedAt">
    • labels?: SessionLabels
  • QuestionClosedReason names superseded.
  • sourceLabels gets no client-side validation, because the SDK validates no other label input. The API answers 400 invalid_event_subscription.
  • There is a changelog entry.

Docs (docs/agents/inputs.mdx): this PR adds field references only:

  • openQuestion on Slack inputs
  • event.outcome, event.question and event.labels in the event-input table

The behaviour itself is documented in #850, #851 and #852. This PR merges cleanly with each of them.

Versions

Publishing is version-gated. Each package.json and its lockfile are bumped together:

Package Published on npm This PR
@opencomputer/agent 0.9.0 0.10.0
@opencomputer/sdk 2.3.1 2.4.0 (and SDK_VERSION)

Both changes are additive, so both are minor bumps. CLI and create-start are unchanged, and no package pins @opencomputer/agent at an exact version.

How to verify

cd agent && npm ci && npm test                                 # 23/23, includes the type-level checks
cd sdks/typescript && npm ci && npm run lint && npm test && npm run build   # 70/70
node scripts/check-opencomputer-package-contract.mjs

New tests:

  • agent/src/index.test.ts: an outcome event with outcome, question and labels, and a channel input with openQuestion. A @ts-expect-error checks that only channel inputs carry openQuestion.
  • sdks/typescript/src/agents/event-subscriptions.test.ts: sourceLabels on the request and on the subscription, and the new OutcomeEvent fields.
  • client.test.ts: sourceLabels round-trips through create, list and get. A non-string value fails with invalid_response.

Not in this PR

New projects scaffolded by the CLI (cli/src/project.ts) still depend on @opencomputer/agent ^0.8.0, so they will not pick up 0.9.0 or 0.10.0. Changing that needs a CLI and create-start release, so it is left for a separate PR.

🤖 Generated with Claude Code

ZIJ and others added 3 commits October 7, 2026 22:44
…n outcome events (0.10.0)

The platform now sends fields the published types did not name, so an
agent could read them only through a cast:

- A Slack message typed while a question is open runs at once and
  carries the pending question as `openQuestion` on the channel input.
- An outcome event carries `outcome: "question"` and the `question` a
  completed turn asked, and the source session's `labels`.
- `result.text` is the last message of a completed turn that wrote text.

New exported types: `Question`, `TurnOutcome`, `SessionLabels`.
@opencomputer/agent 0.9.0 -> 0.10.0, lockfile synced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s on OutcomeEvent (2.4.0)

The platform accepts and returns `sourceLabels` on an event subscription
(1-8 label pairs the source session must carry when the turn is
accepted), and a delivered outcome event carries `outcome`, `question`
and the source session's `labels`. A question can also close as
`superseded` on Slack. The SDK types now name all of them; the
subscription response shape checks `sourceLabels` as a string map.

No client-side validation of `sourceLabels`: the SDK validates no other
label input either; the API answers 400 invalid_event_subscription.

@opencomputer/sdk 2.3.1 -> 2.4.0 (package.json, lockfile, SDK_VERSION),
changelog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vent inputs

Field references only; the behaviour is described on the Slack and API
pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
opencomputer 🟢 Ready View Preview Oct 7, 2026, 9:45 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

This branch was successfully deployed

1 active deployment
staging - docs — 15329af9 Deployed Oct 7, 2026 by mintlify[bot]
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