davsclaus opened a new pull request, #31085:
URL: https://github.com/apache/camel/pull/31085
_Claude Code on behalf of Claus Ibsen_
An agent (the AI panel, an MCP client) that called `tui_get_history` or
`tui_get_table` for the Inspect tab got an empty list (`"rows": []`, no reason
given) unless the user had opened that tab. Since e24a751a5ec9 (Oct 13 2026)
the tab reads the message history only when it opens, or while it is shown. It
has no `ensureDataLoaded()`, which is how the other tabs that load on demand
give an agent their data.
This came up in the human-questions benchmark: its hidden TUI asks the AI
panel questions such as "did all 3 orders go through?". The model called
`tui_get_history` 10 times over two nights and always got the empty list. The
integrations did record the history. A copy of the stock-api example started
the same way (`camel run * --background`) wrote `~/.camel/<pid>-history.json`
with the steps of its last call.
## Changes
- `McpFacade.getTableData`: a read of the Inspect tab while another tab is
shown first reads the history and the traces (`HistoryTab.loadForRead()`).
While Inspect is shown, the reader gets the view the user sees, as before.
- The History view's JSON has a `note`. It says the history holds only the
last completed message: the exchange that finished last, with the routes it
reached downstream through the same breadcrumb
(`BacklogTracer.getLatestMessageHistory`). It also says that with message
tracing on, the Traces view keeps many recent exchanges (up to
`DataRefreshService.MAX_TRACES`, 200 trace steps across them). Without that, a
reader asking about several messages takes the steps of one message for all of
them. An empty history says why it can be empty.
- The `tui_get_history` description says the same.
- The Inspect help page (`help/history.md`) described an exchange list with
columns that neither view has (ID, STATUS, ROUTE, AGO). It now describes the
History and Traces views with their real columns, and how to turn tracing on.
- `camel-jbang-tui-observe.adoc`: "Live Tracing" said `camel run
my-route.yaml --trace`. That sets `camel.main.tracing`, which only logs each
step to the console, so the Inspect tab stays empty. The Traces view needs
`--backlog-trace` (`camel.trace.enabled`) or `camel trace --action=start`. The
page now says so. "History of Last Exchange" says that only one message is kept.
## Tests
- New `McpFacadeHistoryReadTest`, with 3 tests:
- An agent reads the history without the tab being opened, and gets the
note. Without the `McpFacade` change this test fails ("Wanted but not invoked").
- While the tab is shown, the agent reads the user's view.
- An empty history says why.
- The `camel-jbang-plugin-tui` module passes: 2692 tests, 0 failures, 2
skipped (including `SourceSizeTest`, `FooterKeysInHelpTest` and
`HelpTextResourcesTest`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]