davsclaus opened a new pull request, #31205: URL: https://github.com/apache/camel/pull/31205
## Description [CAMEL-27979](https://issues.apache.org/jira/browse/CAMEL-27979) `camel_catalog_doc` (Camel CLI and Camel MCP) searches the message headers of a component only when `optionsFilter` matches no option. Since the option descriptions name headers (CAMEL-23832, #31149), `keyName` and `deleteAfterRead` of aws2-s3 mention `CamelAwsS3Key`. So `optionsFilter=CamelAwsS3Key`, and the prefix `CamelAwsS3`, returned those options and no longer the headers, although `headersHint` tells the model that `optionsFilter=<header name>` returns the header. More headers would break this way as more descriptions name them. This is why `CatalogLookupsTest` (`aFilterThatMatchesNoOptionFindsTheMessageHeaders`, `aCutAnswerNamesTheHeadersItLeavesOut`) and `CatalogDocSeveralOptionsTest.aTermThatIsAMessageHeaderSaysSo` fail on main, and on every PR whose build tests camel-jbang-core. ### Fix In `CatalogDocs.putComponentOptions`, when a single filter term is contained in the name of a message header of the component, an option that matches the term **only where its description names such a header** is not counted as a match. The answer then goes to the headers, as before #31149, and the note names the options that mention the header: > no option matches 'camelawss3key', but 3 message headers do: see headers. … The options deleteAfterRead, keyName name CamelAwsS3Key in the description (optionsFilter=<option name> returns an option) A match in the option name, group or label, or anywhere else in the description, still counts, so a word such as `key` on kafka is answered as before. A filter of several terms is unchanged; each of its terms that only names a header is reported in `unmatchedTerms` (that path asks the single-term answer). ### Tests - `CatalogLookupsTest`: keeps `CamelAwsS3Key`. It now also checks that no option is listed and that the note names `keyName` and `deleteAfterRead`. The header counts go from 2 to 3, because the new description of `CamelAwsS3ProducedKey` mentions `CamelAwsS3Key`. - `CatalogDocSeveralOptionsTest` passes unchanged with `bucketNameOrArn,CamelAwsS3Key`. - All 1117 tests of the `commands.ai` package pass locally. With this, the test change in #31188 (switching to `CamelAwsS3CannedAcl`) is no longer needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) _Claude Code on behalf of davsclaus_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
