[ 
https://issues.apache.org/jira/browse/CAMEL-27752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153032#comment-18153032
 ] 

Guillaume Nodet commented on CAMEL-27752:
-----------------------------------------

Note: *camel-huggingface* required no code change.

The OAuth token in camel-huggingface is only used to download the model at 
producer start (passed once to the DJL Python process as {{HF_TOKEN}} in its 
environment). Inference then runs locally with no HTTP call to Hugging Face per 
exchange, so the token expiring after startup does not affect running routes.

The fix in this issue is exclusively in *camel-docling*, where the OAuth token 
was baked into the client at startup and needed to be re-resolved per request. 
The upgrade guide entry in `camel-4x-upgrade-guide-4_25.adoc` covers only the 
camel-docling behavior change.

> camel-docling, camel-huggingface: oauthProfile token resolved once at 
> startup, should be per-request
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27752
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27752
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.25.0
>
>
> The {{oauthProfile}} option in {{camel-docling}} and {{camel-huggingface}} 
> still resolves the OAuth token once
> at startup (in {{doStart()}}), and stores the string in the configuration. 
> After the token expires, all requests fail with HTTP 401
> until the route is restarted.
> CAMEL-27125 fixed the same problem in {{camel-openai}}, 
> {{camel-langchain4j-agent}}, and {{camel-spring-ai-chat}} by switching to
> per-request supplier lambdas. The same approach should be applied to these 
> two components:
> * {{DoclingProducer.resolveOAuthToken()}} (called from {{doStart()}}) — move 
> to a per-request supplier
> * {{HuggingFaceProducer.resolveOAuthToken()}} (called from {{doStart()}}) — 
> move to a per-request supplier
> Noted in CAMEL-27125 review as a deferred follow-up: camel-ibm-watsonx-ai and 
> camel-ibm-watsonx-data were handled by
> CAMEL-27570 and CAMEL-27575 respectively.
> See: https://github.com/apache/camel/pull/30707



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to