Skip to content

[Question]: Ambiguity with optional fields in proto files #989

@spricet

Description

@spricet

Hi all :)

In the specification, there are lots of references to optional fields. For example:

/**
 * Defines optional capabilities supported by an agent.
 */
export interface AgentCapabilities {
  /** Indicates if the agent supports Server-Sent Events (SSE) for streaming responses. */
  streaming?: boolean;
  /** Indicates if the agent supports sending push notifications for asynchronous task updates. */
  pushNotifications?: boolean;
  /** Indicates if the agent provides a history of state transitions for a task. */
  stateTransitionHistory?: boolean;
  /** A list of protocol extensions supported by the agent. */
  extensions?: AgentExtension[];
}

Note that the fields like streaming etc are optional

However, in the proto files, the fields are defined as such:

message AgentCapabilities {
  // If the agent will support streaming responses
  bool streaming = 1;
  // If the agent can send push notifications to the clients webhook
  bool push_notifications = 2;
  // Extensions supported by this agent.
  repeated AgentExtension extensions = 3;
}

With newer versions of proto3, I believe we can remove this ambiguity by inserting the optional keyword. E.g:

message AgentCapabilities {
  // If the agent will support streaming responses
  optional bool streaming = 1;
  // If the agent can send push notifications to the clients webhook
  optional bool push_notifications = 2;
  // Extensions supported by this agent.
  repeated AgentExtension extensions = 3;
}

Is this a change that should be addressed? I am happy to take a whack at it. I believe it would be a breaking change though

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions