Skip to content

fix: report server capabilities in OpAMP responses#6829

Merged
michel-laterman merged 4 commits intoelastic:mainfrom
michel-laterman:fix/opamp-send-capabilities
Apr 13, 2026
Merged

fix: report server capabilities in OpAMP responses#6829
michel-laterman merged 4 commits intoelastic:mainfrom
michel-laterman:fix/opamp-send-capabilities

Conversation

@michel-laterman
Copy link
Copy Markdown
Contributor

@michel-laterman michel-laterman commented Apr 13, 2026

What is the problem this PR solves?

The OpAMP spec requires the server to report its capabilities bitmask in the first ServerToAgent response. Fleet-server was not setting this field, so agents could not discover what the server supports.

How does this PR solve the problem?

Send the serverCapabilities bitmask (AcceptsStatus, AcceptsEffectiveConfig) in the ServerToAgent response when an agent enrolls or reconnects from a non-active status (offline, disconnected). Active agents (online, error, degraded) do not receive capabilities on every message to reduce response size. An isActiveStatus helper determines which statuses are considered active.

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

Send the server capabilities bitmask (AcceptsStatus, AcceptsEffectiveConfig)
in the first ServerToAgent response when an agent enrolls or reconnects from
a non-active status (offline, disconnected). Active agents (online, error,
degraded) do not receive capabilities on every message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@michel-laterman michel-laterman requested a review from a team as a code owner April 13, 2026 18:13
@michel-laterman michel-laterman added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Apr 13, 2026
@michel-laterman michel-laterman self-assigned this Apr 13, 2026
@michel-laterman michel-laterman added the backport-active-all Automated backport with mergify to all the active branches label Apr 13, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 13, 2026

This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Define disconnected status as a part of openapi.yml so that opamp agent
checkin statuses are defined alongside existing statuses
@michel-laterman michel-laterman added backport-9.4 bug Something isn't working and removed backport-active-all Automated backport with mergify to all the active branches labels Apr 13, 2026
@michel-laterman michel-laterman force-pushed the fix/opamp-send-capabilities branch from a0c865d to ec225a0 Compare April 13, 2026 19:48
@michel-laterman michel-laterman merged commit bc20c8b into elastic:main Apr 13, 2026
11 checks passed
@michel-laterman michel-laterman deleted the fix/opamp-send-capabilities branch April 13, 2026 22:50
mergify bot pushed a commit that referenced this pull request Apr 13, 2026
* feat: report server capabilities in OpAMP responses

Send the server capabilities bitmask (AcceptsStatus, AcceptsEffectiveConfig)
in the first ServerToAgent response when an agent enrolls or reconnects from
a non-active status (offline, disconnected). Active agents (online, error,
degraded) do not receive capabilities on every message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Define disconnected status as a part of openapi.yml

Define disconnected status as a part of openapi.yml so that opamp agent
checkin statuses are defined alongside existing statuses

* Fix linter warnings

* Silence linter

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit bc20c8b)

# Conflicts:
#	docs/opamp.md
#	internal/pkg/api/handleOpAMP.go
#	internal/pkg/api/handleOpAMP_test.go
michel-laterman added a commit that referenced this pull request Apr 14, 2026
…ses (#6832)

* fix: report server capabilities in OpAMP responses (#6829)

* feat: report server capabilities in OpAMP responses

Send the server capabilities bitmask (AcceptsStatus, AcceptsEffectiveConfig)
in the first ServerToAgent response when an agent enrolls or reconnects from
a non-active status (offline, disconnected). Active agents (online, error,
degraded) do not receive capabilities on every message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Define disconnected status as a part of openapi.yml

Define disconnected status as a part of openapi.yml so that opamp agent
checkin statuses are defined alongside existing statuses

* Fix linter warnings

* Silence linter

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit bc20c8b)

# Conflicts:
#	docs/opamp.md
#	internal/pkg/api/handleOpAMP.go
#	internal/pkg/api/handleOpAMP_test.go

* fix backport

---------

Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
Co-authored-by: michel-laterman <michel.laterman@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.4 bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpAMP] fleet-server should send capabilites

2 participants