Skip to content

fix(prompt): omit template content from Nacos update diagnostics - #77

Open
logicwu0 wants to merge 1 commit into
agentic-ai-java:mainfrom
logicwu0:fix/40-prompt-update-logs
Open

logicwu0 wants to merge 1 commit into
agentic-ai-java:mainfrom
logicwu0:fix/40-prompt-update-logs

Conversation

@logicwu0

Copy link
Copy Markdown
Contributor

Describe what this PR does / why we need it

The Nacos listener logged the full prompt template and its variable map at INFO on every successful update. Keep the template name for correlation and report the outcome of each individual update without logging its contents.

Does this pull request fix one issue?

Fixes #40

Describe how you did it

Log result:applied after replacing a template. If its builder or customizer throws, log the template name, failure result and exception type. Propagate a sanitized failure without the original message or cause, which may contain configuration values. Processing still stops at the failed entry; earlier replacements remain applied.

Describe how to verify it

Run mvn -f prompt/argi-prompt-nacos/pom.xml test with Java 21. The regression test captured both the prompt and the variable marker on the original implementation. It checks safe log messages and arguments on a partially applied batch, verifies the exception does not carry the original cause, and checks the following entry is not applied. The module passed all 20 tests locally, with no skips. No live Nacos server was used.

Special notes for reviews

The auto-configuration README describes the new log fields and the per-template meaning of each result. The Logback dependency is test-scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement][OPT-13] 调整动态 Prompt 日志以避免默认输出正文和变量

1 participant