[ 
https://issues.apache.org/jira/browse/CAMEL-25661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-25661:
--------------------------------
    Priority: Minor  (was: Major)

> camel-jbang - AI write tools reload the file at once, not at the next folder 
> scan
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-25661
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25661
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> {{camel_write_file}} and {{camel_edit_file}}, the shared AI tools in 
> camel-jbang-core that the Camel MCP server and {{camel ask}} use, write the 
> file and then wait for dev mode to reload it. {{ReloadOutcome.await}} polls 
> the integration's log every 500 ms, and the tool answers with the reload 
> outcome and what the routes logged after it.
> Dev mode finds the change on its next folder scan: 
> {{FileWatcherResourceReloadStrategy}} scans every 2000 ms and reports a file 
> once it has been unchanged for 200 ms (CAMEL-25032). So every accepted write 
> waits 0.2-2.2 s, about 1 s on average, before the reload even starts.
> The tool knows exactly which files it wrote, and when. It could hand them to 
> the reload strategy at once, as one batch, through the CLI connector (which 
> already has a {{reload}} action), and record their modification time and size 
> as seen, so the next scan does not reload the same change again.
> h3. Benefit
> * Each write answers about a second sooner, for agents and for people using 
> {{camel ask}} or the MCP server from an IDE.
> * In a local-model benchmark run (21 examples, about 114 accepted writes per 
> run) that is about 2 minutes per run.
> h3. Care
> * No double reload: a second reload of the same change rebuilds a rest route 
> while an HTTP call may be in flight, and that call is answered 404.
> * Properties and routes written together stay one batch, properties first 
> (CAMEL-25041).
> * Files changed outside the tools (by an editor) are still found by the scan, 
> as today.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to