Skip to content

Fulfillments in TS SDK are not Partial #1818

@tomkis

Description

@tomkis

Pre-requisities

  • I am using the newest version of the platform (agentstack version shows that CLI and platform are the same version, and there is no newer version available)

Describe the bug
The SDK crashes when oauthRedirectUri is not provided in fulfillments, even though fulfillments are designed to be partial. The Fulfillments interface requires oauthRedirectUri as a mandatory property, and it's called unconditionally in handle-agent-card.ts, causing a runtime error when the function is missing. The fullfilments should always be partial.

To Reproduce
Steps to reproduce the behavior:

  1. Create fulfillments without providing oauthRedirectUri
  2. Pass the partial fulfillments to resolveMetadata in handle-agent-card.ts
  3. The code crashes when calling fulfillments.oauthRedirectUri() on line 99

Expected behavior
Since fulfillments are partial, oauthRedirectUri should be optional. The code should check if oauthRedirectUri exists before calling it, or the interface should make it optional.

Logs / Screenshots / Code snippets
Location: apps/agentstack-sdk-ts/src/client/a2a/extensions/handle-agent-card.ts

// Line 35: oauthRedirectUri is required in the interface
oauthRedirectUri: () => string | null;

// Line 99: Called unconditionally without checking if it exists
const oauthRedirectUri = fulfillments.oauthRedirectUri();

Set-up:

  • Model provider: N/A (SDK issue)

Additional context
The crash occurs because the Fulfillments interface defines oauthRedirectUri as a required property, but when fulfillments are partial (as they should be), this property may not be present, leading to a runtime error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingui

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions