Repository navigation
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
Draft
agent 0.10.0, sdk 2.4.0: types for openQuestion, outcome-event question and labels, sourceLabels#853ZIJ wants to merge 3 commits into
ZIJ wants to merge 3 commits into
Conversation
…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>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
openQuestion: { id, text, options }, which is the pending question. A question that closes this way has the reasonsuperseded.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.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)AgentInputgainsopenQuestion?: Question.OutcomeEventgainsoutcome?,question?andlabels?.Question({ id, text, options }),TurnOutcome("question") andSessionLabels.result,HeldInputanduseTool("ask")now describe how Slack behaves.@opencomputer/sdk(sdks/typescript/src/agents/)CreateEventSubscriptionBodyandEventSubscriptiongainsourceLabels?. The response shape checks it as a string map.OutcomeEventgains:outcome?: TurnOutcomequestion?: Omit<SessionQuestion, "askedAt">labels?: SessionLabelsQuestionClosedReasonnamessuperseded.sourceLabelsgets no client-side validation, because the SDK validates no other label input. The API answers400 invalid_event_subscription.Docs (
docs/agents/inputs.mdx): this PR adds field references only:openQuestionon Slack inputsevent.outcome,event.questionandevent.labelsin the event-input tableThe behaviour itself is documented in #850, #851 and #852. This PR merges cleanly with each of them.
Versions
Publishing is version-gated. Each
package.jsonand its lockfile are bumped together:@opencomputer/agent@opencomputer/sdkSDK_VERSION)Both changes are additive, so both are minor bumps. CLI and create-start are unchanged, and no package pins
@opencomputer/agentat an exact version.How to verify
New tests:
agent/src/index.test.ts: an outcome event withoutcome,questionandlabels, and a channel input withopenQuestion. A@ts-expect-errorchecks that only channel inputs carryopenQuestion.sdks/typescript/src/agents/event-subscriptions.test.ts:sourceLabelson the request and on the subscription, and the newOutcomeEventfields.client.test.ts:sourceLabelsround-trips through create, list and get. A non-string value fails withinvalid_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