OpAMP relies on a capability-based exchange to ensure that Agents and Servers can communicate even if they implement different versions or subsets of the specification.
Capability Discovery
During the initial message exchange, both parties declare their supported capabilities using bit-fields:
- Agent Capabilities: Communicated via the
AgentToServer message. - Server Capabilities: Communicated via the
ServerToAgent message.
Crucial Rule: Once a peer learns that a capability is NOT supported, it MUST stop attempting to use that capability with that specific peer.
Handling Future Capabilities
OpAMP supports two types of extensions to maintain interoperability between current and future versions:
- Ignorable Capability Extensions: New functionality added via new fields in Protobuf messages. Older recipients will simply ignore these unknown fields during deserialization.
- Non-Ignorable Capability Extensions: For functionality that cannot be ignored, OpAMP uses reserved bits in the
AgentToServer and ServerToAgent capability fields.- Clients and Servers MUST set these reserved bits to
0 when sending messages. - A newer implementation seeing a
0 in these bits knows the sender does not support the new capability and can adjust its behavior accordingly.