oscerd commented on PR #25899:
URL: https://github.com/apache/camel/pull/25899#issuecomment-5478634634
Thanks — the DEBUG note was worth acting on rather than filing away, so I
have taken it too.
You are right about the change in blast radius: that line only ran for chat
before, and centralising the token made it apply to all ten tasks, with the
token now sitting in the script it prints. Rather than redact the string,
`loadModel()` now logs the script **before** `withAuthToken()` prepends the
token, and writes the token-bearing version to the handler file:
```java
String pythonScript = getPythonScript();
// logged before the token is prepended: withAuthToken writes the configured
token into the
// script, and this now runs for every task rather than only chat
if (LOG.isDebugEnabled()) {
LOG.debug("Generated Python script for task {}:\n{}", config.getTask(),
pythonScript);
}
Files.writeString(handlerPath, withAuthToken(pythonScript));
```
The log keeps its diagnostic value — the token is one prepended line, not
part of the script anyone is debugging — and there is no redaction to get wrong
later.
The other two points from this round were already handled in the previous
commit: the token is escaped for single quotes, and `ChatPredictor`'s
`tokenClause` plus the `%s` placeholder in `chat.py` are gone, with a test
asserting no `token=` survives in the generated script. @gnodet's empty-string
coverage is in as well.
Module tests pass, and a full reactor build from the root is green with
nothing left uncommitted.
_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]