You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/03 20:22:37 UTC

[PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

davsclaus opened a new pull request, #27317:
URL: https://github.com/apache/camel/pull/27317

   [CAMEL-25296](https://issues.apache.org/jira/browse/CAMEL-25296)
   
   `camel_get_log` (camel-jbang-core `LogFileReader`, used by camel-jbang-mcp and the AI tools of the camel-jbang views) returned each error with a `detail` block of up to 20 lines. For the error handler's "Failed delivery" record that block is the message history and the Java stack trace. Its first line already has what is needed: the route and node, the source location, and the exception with its message. `camel_get_errors` has the stack traces anyway.
   
   In the local-model benchmark, the circuit-breaker example's log is mostly such records. A tool result capped at 6,000 characters showed about three of them, so the model polled the log again and again, and in one run filled a 64k context.
   
   ### What changes
   
   Without `details`, which is the default:
   
   - **The stack-trace block is left out.** Only stack traces and message history are dropped; other multi-line text, such as a pretty-printed body, stays a `detail` block.
   - **The record keeps its first line and level**, so an error is still an ERROR with its exception.
   - **New fields on records that lost their trace:**
     - `detailLines`: how many lines were left out
     - `cause`: the exception, when the first line doesn't name it (the last `Caused by`)
     - `at`: the first frame of the user's own code, a bean, a processor or a script. It walks from the root cause up, because a `Caused by` section can end in `... N more` and miss that frame. JDK module and class-loader prefixes are stripped.
   - **A one-line `note`** in the result points to `details=true` and `camel_get_errors`, only when something was left out.
   
   Unchanged:
   
   - `filter` still searches the whole record, trace included.
   - `details: true` returns everything as before, and internal callers such as `ReloadOutcome` keep the full records.
   - The tool description is shorter than before, so the full tool set's prompt stays within `AiPanelPromptBudgetTest`'s budget.
   
   ### Tests
   
   - `LogFileReaderTest`, 8 new tests:
     - the real error handler record from the benchmark
     - a twice-wrapped NPE: `at` is the bean's line
     - a root cause cut short by `... N more`: `at` comes from the section above
     - a Groovy script frame
     - a pretty-printed body keeps its detail
     - the filter on a left-out trace
     - `details=true` unchanged
     - no internal fields leak
   - Module suites: camel-jbang-core 1451, camel-jbang-mcp 426, camel-jbang-plugin-tui 1715, all pass.
   - Live through the MCP server against a route whose supplier fails every second: 9 ERROR records took 3,569 characters instead of 24,002.
   
   Side finding, not changed here: the repeated-record folding of CAMEL-24911 never applies to error handler records, because their first line carries the unique MessageId.
   
   🤖 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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #27317:
URL: https://github.com/apache/camel/pull/27317#issuecomment-5973239334

   The first CI run failed on uncommitted changes in `eip-samples.json`. That isn't caused by this PR: CAMEL-24649 (#26203, merged just before) changed `rest-dsl-openapi.adoc`, which feeds the generated samples, without regenerating them. I rebased onto main and added the regenerated file from the CI patch as its own commit (64edd53b17f0). Other PRs that build camel-jbang-core will hit the same check until this or a regen on main lands.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27317:
URL: https://github.com/apache/camel/pull/27317#issuecomment-5973233433

   <!-- regen-patch -->
   ### :warning: Generated files are out of date
   
   The [CI build](https://github.com/apache/camel/actions/runs/37151313908) regenerated files that are not committed on this PR.
   
   If *Allow edits from maintainers* is enabled, a maintainer bot will automatically
   push a "Regen" commit to this branch shortly.
   
   Otherwise, you can apply the patch manually — the missing changes are available
   as the `regen-patch` artifact of that run:
   
   ```bash
   gh pr checkout 27317 --repo apache/camel
   gh run download 37151313908 --repo apache/camel -n regen-patch
   git apply --index regen.patch && rm regen.patch pr-number
   git commit -m "Regen" && git push
   ```
   
   Alternatively, run `./etc/scripts/regen.sh` locally and commit the resulting changes.
   If the patch does not apply cleanly, update the branch from the base branch first —
   the patch was generated against the merge with the base branch.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27317:
URL: https://github.com/apache/camel/pull/27317#issuecomment-5973149800

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27317:
URL: https://github.com/apache/camel/pull/27317#issuecomment-5973399105

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   - `dsl/camel-jbang/camel-jbang-mcp`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 6 of 698 tested, 8 compile-only — current: 6 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **6 affected modules** (current approach: 6).
   
   **Skip-tests mode would test 6 modules** (3 direct + 5 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (6)</summary>
   
   - `camel-jbang-mcp` ← dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/AuthoringTools.java, dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/AuthoringToolsTest.java
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   - `dsl/camel-jbang/camel-jbang-mcp`: 1 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (16 modules, 16.7s total)</summary>
   
   **Total reactor time:** 16.7s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Docs | 16.7s | SUCCESS |
   | Camel :: Coverage | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Integration tests | n/a |  |
   | Camel :: JBang :: MCP | n/a |  |
   | Camel :: JBang :: Main | n/a |  |
   | Camel :: JBang :: Plugin :: Edit | n/a |  |
   | Camel :: JBang :: Plugin :: Generate | n/a |  |
   | Camel :: JBang :: Plugin :: Kubernetes | n/a |  |
   | Camel :: JBang :: Plugin :: MCP | n/a |  |
   | Camel :: JBang :: Plugin :: Route Parser | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   | Camel :: JBang :: Plugin :: Testing | n/a |  |
   | Camel :: JBang :: Plugin :: Validate | n/a |  |
   | Camel :: Launcher | n/a |  |
   | Camel :: Launcher :: Container | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Docs` (16.7s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37152035290)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25296: camel-jbang - camel_get_log leaves out stack traces by default, keeping the error line [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27317:
URL: https://github.com/apache/camel/pull/27317


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org