You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tinyjuice-host): stop logging the retrieve lookup token - #125
juice_retrieve logged the compacted-output retrieval token verbatim at debug level on every successful lookup. The token is the lookup key for cached full tool output that compaction keeps out of the transcript, so anyone with the log and the store could pull that content back. The log line now records only the retrieved byte count.
Behavior only: the [tinyjuice-host::retrieve] debug line no longer includes the lookup token. Nothing else changes; the miss message shown to the agent is untouched.
Tests
New regression test successful_retrieve_never_logs_the_lookup_token captures debug output during execute and asserts the token never appears in it.
(clippy ran as cargo clippy -p tinyjuice-host --all-targets -- -D warnings, clean; cargo test -p tinyjuice-host gave 38 passed, 0 failed. The unticked rows need tree-sitter/criterion artifacts that are not vendored for this checkout.)
Documentation
No docs changes needed; no public API change.
Summary by CodeRabbit
Bug Fixes
Retrieval logs no longer include the access token, while still reporting the number of bytes retrieved.
The debug log on a successful juice_retrieve lookup interpolated the
retrieval token verbatim. The token is the lookup key for cached full
tool output that compaction deliberately keeps out of the transcript,
so anyone with the log and the store could pull that content back.
Log only the non-sensitive metadata (retrieved byte count) instead.
Co-authored-by: Saim Shafique <128062316+sx4im@users.noreply.github.com>
Verdict: Ready for maintainer review · Priority: none Coverage: Reviewed 2 of 2 files.
Pull request purpose (title): fix(tinyjuice-host):…
Diagnostics and supporting details
Full summary
Pull request purpose (title): fix(tinyjuice-host): stop logging the retrieve lookup token. Tiny Sweeper completed its review; deterministic results follow.
Review snapshot
Change surface
Files
Review signal
Count
Production
1
Active findings
0
Tests
1
Noted findings
0
Documentation
0
Resolved findings
0
Configuration
0
Pending checks/questions
0
Completeness: Complete Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.
Features
Modified — Retrieve debug log redaction: The debug line emitted on successful retrieval no longer includes the lookup token and keeps only the byte count, reducing exposure of the key used to retrieve compacted full tool output. (crates/tinyjuice-host/src/retrieve_tool.rs, crates/tinyjuice-host/src/retrieve_tool.rsimpl Tool for RetrieveToolOutputTool {)
Added — Lookup-token log regression test: Adds a test that captures debug output during `execute` and asserts the fixture lookup token never appears, guarding the redaction behavior. (crates/tinyjuice-host/src/retrieve_tool_tests.rs)
Tests
No supported feature-to-test mapping was produced. Test execution is not inferred.
Findings
No active actionable findings.
Before merge
None.
Agent review details
critique
Conclusion: Success
Scope reviewed: all assigned evidence
Positive: Answered with no findings; described the production redaction as straightforward and the test as following the repository's sibling-test convention, while noting the missing positive control in the negative assertion.
Lane summary: The production change is a straightforward redaction: the debug log in `RetrieveToolOutputTool::execute` no longer interpolates the lookup token, and nothing else in the changed file depended on that field. The new test file follows the repository's sibling-test convention and does verify the shipped behaviour. One weakness: the negative assertion has no positive control, so it cannot tell 'the token was not logged' from 'no record was captured at all', which is what would happen if `log::set_logger` returned an error (its result is discarded) or if the `enabled` threshold were wrong.
security
Conclusion: Success
Scope reviewed: all assigned evidence
Positive: Answered with no security defect introduced; removing the lookup token from the debug log reduces exposure, and the token used in the test is fixture data.
Lane summary: The change removes the lookup token from the debug log line in retrieve_tool.rs and adds a test asserting the token never reaches the log. The test installs a process-global logger via OnceLock, which is fine for a single test process, and the token is a test fixture asserting containment, not a leak. No security defect introduced.
tests
Conclusion: Success
Scope reviewed: all assigned evidence
Positive: Answered with no reportable defect; the regression test would fail if the token interpolation were restored, and the other log sites in the file are unchanged.
Lane summary: The change removes the lookup token from a debug log line and adds a test that installs a capturing logger and asserts the token never appears in captured records. The test is a real regression guard: restoring `token={token}` in the log call makes it fail. One weakness: the test only exercises the success path, so the token is still logged nowhere else — but the diff only changed that one line, and the other log sites in this file are unchanged. No reportable defect.
commits
Conclusion: Success
Scope reviewed: all assigned evidence
Positive: Answered with no sensitive content in committed files.
Lane summary: No sensitive content in committed files.
description
Conclusion: Success
Scope reviewed: all assigned evidence
Positive: Answered with no defects; the description matches the behavior change—dropping the token and keeping the byte count—and the added regression test.
Lane summary: The change does exactly what the description says: the `[tinyjuice-host::retrieve]` debug line drops the lookup token and keeps only the byte count, and a regression test in the sibling `retrieve_tool_tests.rs` asserts the token never reaches the log. The test file follows the repository's test-layout rules, and the description accurately covers the behaviour change and the test. No defects found.
No actionable comments were generated in the recent review.
Walkthrough
The retrieval debug log now reports the retrieved byte count without logging the lookup token. A test captures log records during successful retrieval and checks that they do not contain the token.
Changes: Retrieval logging
Layer / File(s)
Summary
Retrieval log and privacy test crates/tinyjuice-host/src/retrieve_tool.rs, crates/tinyjuice-host/src/retrieve_tool_tests.rs
The debug log records the retrieved byte count without the token. A capturing logger supports a test that checks successful retrieval logs for the token.
The change removes lookup tokens from successful-retrieval logs without changing retrieval results. No actionable merge-blocking risk remains.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely identifies the main change: preventing the retrieve lookup token from being logged.
Linked Issues check
[#8447] Coding objective: stop logging the compacted-output retrieval token on successful lookup; log only non-sensitive metadata. At head, RetrieveToolOutputTool::execute in `crates/tinyjuice-host/…
Out of Scope Changes check
The whole-PR diff against merge base 203f4f6 changes two files. (1) crates/tinyjuice-host/src/retrieve_tool.rs: the debug log line drops token= and the token argument. This is the change #8447 req…
Full details: Linked Issues check
Explanation
[#8447] Coding objective: stop logging the compacted-output retrieval token on successful lookup; log only non-sensitive metadata. At head, RetrieveToolOutputTool::execute in crates/tinyjuice-host/src/retrieve_tool.rs logs "[tinyjuice-host::retrieve] retrieved bytes={}" with text.len() only. The token is absent from this log call. The miss path (miss_message(token)) returns a tool result and does not log. No other log call in this file prints the token. The byte count is an allowed metadata field under #8447. The new test successful_retrieve_never_logs_the_lookup_token in retrieve_tool_tests.rs captures debug records during a successful execute and asserts the token string does not appear. The issue's shared execute path also serves the legacy retrieve_tool_output name, as #8447 describes. Non-coding items in #8447 (release tinyjuice, bump openhuman module record/gitlink) are excluded from this assessment. Minor test caveat: the capture logger is installed with log::set_logger and its result is ignored. If another logger were already installed in the test binary, the test would pass without capturing any record. This does not change the verdict on the code.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base 203f4f6 changes two files. (1) crates/tinyjuice-host/src/retrieve_tool.rs: the debug log line drops token= and the token argument. This is the change #8447 requests. (2) crates/tinyjuice-host/src/retrieve_tool_tests.rs: adds a capturing log::Log implementation, a capture_logger helper, and the regression test. The helper and test directly support verifying the logging fix. No unrelated code, dependency, or public API change appears in the reviewed diff. The PR description states no public API change, and the raw summary lists no changed public declarations. The release and openhuman gitlink update named in #8447 are not part of this PR, so they add no out-of-scope change.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ast-grep (0.51.1)
ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/rust/security/secrets-reqwest-hardcoded-auth-rust.yml
Clippy (1.99.0)
Clippy execution failed
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
A rabbit checks the log at night, The byte count stays; the token’s out of sight. A captured line is searched with care, No lookup secret lingers there. The rabbit hops beneath the moon, And stamps this tidy change as done.
CodeRabbit Verify
Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 8b306274-9918-49f5-a93c-c619ae9bbf63
Commits
Reviewing files that changed from the base of the PR and between 203f4f6 and e89db80.
Files selected for processing: 2
crates/tinyjuice-host/src/retrieve_tool.rs
crates/tinyjuice-host/src/retrieve_tool_tests.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
priority: p3Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
juice_retrievelogged the compacted-output retrieval token verbatim at debug level on every successful lookup. The token is the lookup key for cached full tool output that compaction keeps out of the transcript, so anyone with the log and the store could pull that content back. The log line now records only the retrieved byte count.Fixes tinyhumansai/openhuman#8447.
API Or Behavior Changes
Behavior only: the
[tinyjuice-host::retrieve]debug line no longer includes the lookup token. Nothing else changes; the miss message shown to the agent is untouched.Tests
New regression test
successful_retrieve_never_logs_the_lookup_tokencaptures debug output duringexecuteand asserts the token never appears in it.cargo fmt --checkcargo clippy --all-targets -- -D warningscargo clippy --all-targets --all-features -- -D warningscargo build --all-targetscargo build --all-targets --all-featurescargo testcargo test --all-features(clippy ran as
cargo clippy -p tinyjuice-host --all-targets -- -D warnings, clean;cargo test -p tinyjuice-hostgave 38 passed, 0 failed. The unticked rows need tree-sitter/criterion artifacts that are not vendored for this checkout.)Documentation
No docs changes needed; no public API change.
Summary by CodeRabbit