[9.4](backport #6829) fix: report server capabilities in OpAMP responses#6832
[9.4](backport #6829) fix: report server capabilities in OpAMP responses#6832mergify[bot] wants to merge 1 commit into9.4from
Conversation
* 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
|
Cherry-pick of bc20c8b has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🔍 Preview links for changed docs |
Vale Linting ResultsSummary: 2 errors, 1 warning, 1 suggestion found ❌ Errors (2)
|
| File | Line | Rule | Message |
|---|---|---|---|
| docs/opamp.md | 35 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
💡 Suggestions (1)
| File | Line | Rule | Message |
|---|---|---|---|
| docs/opamp.md | 15 | Elastic.Ellipses | In general, don't use an ellipsis. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
| <<<<<<< HEAD | ||
| kOpAMPMod = "opAMP" | ||
| ======= | ||
| kOpAMPMod = "opAMP" | ||
| serverCapabilities = uint64(protobufs.ServerCapabilities_ServerCapabilities_AcceptsStatus | | ||
| protobufs.ServerCapabilities_ServerCapabilities_AcceptsEffectiveConfig) | ||
| >>>>>>> bc20c8b (fix: report server capabilities in OpAMP responses (#6829)) | ||
| ) |
There was a problem hiding this comment.
🔴 Critical api/handleOpAMP.go:38
Unresolved git merge conflict markers (<<<<<<< HEAD, =======, >>>>>>> bc20c8b) at lines 38-45 will cause a compilation failure. The Go compiler cannot parse these conflict markers as valid syntax. Resolve the conflict by keeping the server capabilities constant and the AgentDisconnect handling logic from the incoming change.
-<<<<<<< HEAD
- kOpAMPMod = "opAMP"
-=======
kOpAMPMod = "opAMP"
serverCapabilities = uint64(protobufs.ServerCapabilities_ServerCapabilities_AcceptsStatus |
protobufs.ServerCapabilities_ServerCapabilities_AcceptsEffectiveConfig)
->>>>>>> bc20c8b (fix: report server capabilities in OpAMP responses (#6829))Also found in 1 other location(s)
docs/opamp.md:3
Unresolved git merge conflict markers are being committed to
docs/opamp.md. Lines 3 (<<<<<<< HEAD), 4 (=======), and 59 (>>>>>>> bc20c8b (fix: report server capabilities in OpAMP responses (#6829))) contain conflict markers that should have been resolved before committing. This will render the documentation malformed and confusing to users viewing the file.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file internal/pkg/api/handleOpAMP.go around lines 38-45:
Unresolved git merge conflict markers (`<<<<<<< HEAD`, `=======`, `>>>>>>> bc20c8b`) at lines 38-45 will cause a compilation failure. The Go compiler cannot parse these conflict markers as valid syntax. Resolve the conflict by keeping the server capabilities constant and the `AgentDisconnect` handling logic from the incoming change.
Evidence trail:
File: internal/pkg/api/handleOpAMP.go, lines 38-43 (viewed at REVIEWED_COMMIT). The conflict markers `<<<<<<< HEAD`, `=======`, and `>>>>>>> bc20c8b` are present in the const block, which will cause Go compilation failure.
Also found in 1 other location(s):
- docs/opamp.md:3 -- Unresolved git merge conflict markers are being committed to `docs/opamp.md`. Lines 3 (`<<<<<<< HEAD`), 4 (`=======`), and 59 (`>>>>>>> bc20c8b (fix: report server capabilities in OpAMP responses (#6829))`) contain conflict markers that should have been resolved before committing. This will render the documentation malformed and confusing to users viewing the file.
|
This pull request is now in conflicts. Could you fix it @mergify[bot]? 🙏 |
What is the problem this PR solves?
The OpAMP spec requires the server to report its capabilities bitmask in the first
ServerToAgentresponse. 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
serverCapabilitiesbitmask (AcceptsStatus,AcceptsEffectiveConfig) in theServerToAgentresponse 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. AnisActiveStatushelper determines which statuses are considered active.Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues
This is an automatic backport of pull request fix: report server capabilities in OpAMP responses #6829 done by Mergify.