Environment
- SDK Package Version: 3.2.0
- Python Version: Python 3.12.13
- Nacos Server Version: 3.2.3
- OS: Windows 11
Describe the Bug
When using the AI Prompt API with the default gRPC transport, an expected
"prompt not modified" response is logged as an ERROR by the SDK.
The response is:
Error [304]: prompt data is up to date
This appears to be a normal cache validation response, not an actual failure.
The prompt cache layer already handles NOT_MODIFIED (304) as an expected
condition and ignores it.
Steps to Reproduce
- Create a
NacosAIService client.
- Subscribe to a prompt using
SubscribePromptParam.
- Do not modify the prompt.
- Wait for the prompt cache polling interval.
- The SDK receives a response with code
304.
Expected Behavior
A 304 response for an unchanged prompt should not be logged at ERROR level.
Possible options:
- Do not log 304 responses.
- Log them at DEBUG level.
- Log them at INFO level if diagnostic visibility is required.
Unexpected response codes such as 401, 403, 404, 500, connection failures,
and invalid responses should continue to be logged as errors.
Actual Behavior
The SDK logs an ERROR similar to:
failed to invoke nacos config server : Error [304]: prompt data is up to date
This log is emitted from AIGRPCClientProxy.request_ai_server():
https://github.com/nacos-group/nacos-sdk-python/blob/master/v2/nacos/ai/remote/ai_grpc_client_proxy.py
The exception is then handled by PromptCacheHolder as an expected
NOT_MODIFIED response.
Relevant code path
The gRPC proxy currently logs every NacosException at ERROR level:
except NacosException as e:
self.logger.error(
"failed to invoke nacos config server : " + str(e)
)
raise e
Environment
Describe the Bug
When using the AI Prompt API with the default gRPC transport, an expected
"prompt not modified" response is logged as an ERROR by the SDK.
The response is:
This appears to be a normal cache validation response, not an actual failure.
The prompt cache layer already handles
NOT_MODIFIED(304) as an expectedcondition and ignores it.
Steps to Reproduce
NacosAIServiceclient.SubscribePromptParam.304.Expected Behavior
A 304 response for an unchanged prompt should not be logged at ERROR level.
Possible options:
Unexpected response codes such as 401, 403, 404, 500, connection failures,
and invalid responses should continue to be logged as errors.
Actual Behavior
The SDK logs an ERROR similar to:
This log is emitted from
AIGRPCClientProxy.request_ai_server():https://github.com/nacos-group/nacos-sdk-python/blob/master/v2/nacos/ai/remote/ai_grpc_client_proxy.py
The exception is then handled by
PromptCacheHolderas an expectedNOT_MODIFIEDresponse.Relevant code path
The gRPC proxy currently logs every
NacosExceptionat ERROR level: