oscerd commented on PR #25899:
URL: https://github.com/apache/camel/pull/25899#issuecomment-5475493455

   Thanks @davsclaus and @gnodet — addressed in the latest commit:
   
   1. **Token escaping** (davsclaus): the token is now interpolated as 
`authToken.replace("'", "\\'")`, so a single quote in the token (or an 
OAuth-resolved value) can no longer break out of / inject into the Python 
string literal. Since this is the shared path for all 10 tasks, it's fixed in 
`withAuthToken`.
   2. **Redundant chat token clause** (gnodet): removed the `tokenClause` from 
`ChatPredictor.getPythonScript()` and the trailing placeholder from `chat.py`. 
The token now flows only through the central `HF_TOKEN` env var, so chat no 
longer passes it twice.
   3. **Tests**: added the empty-token case and a single-quote escape case to 
`AuthTokenInjectionTest`, plus a new `ChatScriptFormatTest` guarding 
`chat.py`'s format-argument alignment after the placeholder was removed.
   
   On the backport note: I'll open a `camel-4.22.x` backport once this merges 
(the `camel-huggingface` module doesn't exist on `camel-4.18.x`).
   
   _Claude Code on behalf of oscerd_


-- 
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]

Reply via email to