Skip to content

fix(prompt): omit exception contents from retry warnings - #2281

Open
kyboi wants to merge 1 commit into
JetBrains:developfrom
Kreoh:contribute/retry-log-privacy
Open

kyboi wants to merge 1 commit into
JetBrains:developfrom
Kreoh:contribute/retry-log-privacy

Conversation

@kyboi

@kyboi kyboi commented Sep 30, 2026

Copy link
Copy Markdown

RetryingLLMClient appends arbitrary exception messages to WARN output for ordinary retries and streaming failures before the first token. These messages can contain provider response bodies or credentials. Omit that text while retaining operation context, attempt counts and retry delay.

Related issue: KG-377, Review logging.

This fix is already included in Kroog and is working in production applications using Kroog. This PR adapts that implementation into a minimal patch for Koog. Original implementation: a9b1ecdbfca6656b71ca54188fa29c9e27798326. Kroog uses structured retry metadata; this patch retains Koog's existing warning format and removes exception text from its two warning paths. It introduces no observer, classification or cancellation changes.

Two JVM regression tests capture SLF4J Simple output and verify that ordinary and streaming retries preserve useful context without disclosing synthetic credentials, response contents or exception causes. The backend already comes from test-utils, so there are no new dependencies. These tests use local mock clients; production experience relates to Kroog.

Validation on JDK 21:

  • Without the patch, both logger capture tests fail because WARN output contains the private response marker and synthetic API key.
  • ./gradlew :prompt:prompt-executor:prompt-executor-clients:jvmTest :prompt:prompt-executor:prompt-executor-clients:jvmJar :prompt:prompt-executor:prompt-executor-clients:ktlintCheck :prompt:prompt-executor:prompt-executor-clients:generatePomFileForJvmPublication --max-workers=2 passes. All 50 affected JVM tests pass, with no skips.
  • Kotlin JVM ABI tools generate an exact match to the checked-in api/jvm/prompt-executor-clients.api dump from the compiled JVM classes. git diff --check passes.

No public API or ABI dump edits. JVM validation only; other platform tests and live-provider tests have not run.

This branch has not been deployed

No deployments
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.

1 participant