davsclaus opened a new pull request, #28209: URL: https://github.com/apache/camel/pull/28209
https://issues.apache.org/jira/browse/CAMEL-25899 Two gaps from the r20 benchmark runs against a local model: 1. **The hint of a failed exchange was cut off.** The reload outcome of a write cuts each line at 400 characters. The line of a failed exchange starts with some 250 characters of error-handler text: `Failed delivery for (MessageId: … on ExchangeId: …) at …. Exhausted after delivery attempt: 1 caught: org.apache.camel.…`. The hint comes late in the exception message ("unmarshal it first …"). In the enrich example the line was 831 characters, and the hint started at about character 544, so the agent did not see it in 119 writes. Now a WARN or ERROR line is compacted (`ReloadOutcome.compact`). The message ids and attempt count go, and so do `on the exchange: Exchange[…]`, `Exchange[<id>]. `, the packages of exception classes, and bean dumps over 80 characters. Such a line may be 800 characters. The line becomes `ERROR Failed at incoming-orders[log14] enrich-and-dedupe.camel.yaml:42: RuntimeBeanExpressionException: … (the value is the file as read (a GenericFile), not it s data: unmarshal it first, …)`, with the whole hint. 2. **A write of a script the routes load was answered at once.** A Groovy script loaded with `groovy: resource:file:mapping.groovy` got "reloads it now" in 3 ms. Dev mode reloads the routes after the change, but the agent read the errors before the reload and saw none. Now a write of a script or template (`.groovy`, `.js`, `.py`, `.ftl`, `.vm`, `.mustache`, `.jslt`, `.jsonata`) waits for the reload, as a route write does. ## Tested end to end With an MCP server built from this branch and an app in dev mode that loads `mapping.groovy`, I wrote a broken script with `camel_write_file`. It answered in 3.2 s: *"The running integration reloaded its routes, which load the file. After the reload it logged: ERROR Failed at mapping[setBody4] mapping.camel.yaml:14: NullPointerException: Cannot get property 'id' on null object"*. ## Tests - `ReloadOutcomeTest`: the hint of the real enrich line fits, and the exchange and bean dumps go. - `AuthoringToolsTest`: which files wait for the reload. - camel-jbang-core 2403 + 237 and camel-jbang-mcp 503 pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m -- 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]
