Skip to content

Claude/kg retrieval logs merge m4tvyg - #143

Merged
maximusunc merged 2 commits into
mainfrom
claude/kg-retrieval-logs-merge-m4tvyg
Aug 28, 2026
Merged

Claude/kg retrieval logs merge m4tvyg#143
maximusunc merged 2 commits into
mainfrom
claude/kg-retrieval-logs-merge-m4tvyg

Conversation

@maximusunc

Copy link
Copy Markdown
Collaborator

No description provided.

claude added 2 commits August 24, 2026 16:14
take_callback_logs drops entries below the requested log level, but the
level it was given comes from the merge task -- and that traces back to
`response.get("log_level")` on the callback body in the /callback route. A
TRAPI response has no log_level field for a retrieval service to echo, so
that read is None on every callback and the level defaults to INFO no matter
what the client asked for.

The lookup workers do forward log_level on the way out, so a DEBUG query
gets DEBUG entries back from the retrieval -- and then had them stripped
against an INFO that was never asked for.

Resolve the level from the stored query instead, which the merge child
already loads, so no extra fetch: DEBUG entries survive a DEBUG query, and a
retrieval that reports at DEBUG regardless still can't flood one that asked
for INFO. The child's own logger follows the same level.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012QwdpTHjvsiTS1wfuq395b
The /callback handler read the requested level off the body a subservice
posted. A TRAPI response has no log_level field, so that read was None on
every callback: the handler, the merge task it enqueues, and everything
downstream of that ran at INFO no matter what the client asked for.

Read it from the stored query instead -- the only record of what was asked
for once a request is handed off. get_query_log_level does that lookup, and
the callback handler resolves the query before it logs anything, so its own
records are at the right level too, not just the ones it hands on.

The level is now understood in one place: resolve_log_level over a single
name->number mapping, used by query intake, the callback handler, the merge
child (which reads the level off the query it already loads), and the filter
for log entries a retrieval sends back. Intake previously indexed
logging._nameToLevel directly, so a query naming a level we don't know --
"VERBOSE", say -- failed with a KeyError instead of falling back.

Costs one small Redis read of the query blob per callback, on a path that
already does two postgres lookups and a write.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012QwdpTHjvsiTS1wfuq395b
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.96774% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.47%. Comparing base (667465e) to head (104fe3a).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
shepherd_server/base_routes.py 44.44% 4 Missing and 1 partial ⚠️
shepherd_utils/db.py 63.63% 3 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
shepherd_utils/logger.py 100.00% <100.00%> (ø)
shepherd_utils/shared.py 77.03% <100.00%> (ø)
workers/merge_message/worker.py 68.61% <100.00%> (+0.06%) ⬆️
shepherd_utils/db.py 64.59% <63.63%> (+1.04%) ⬆️
shepherd_server/base_routes.py 52.19% <44.44%> (+12.52%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 667465e...104fe3a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maximusunc
maximusunc merged commit b513190 into main Aug 28, 2026
2 checks passed
@maximusunc
maximusunc deleted the claude/kg-retrieval-logs-merge-m4tvyg branch August 28, 2026 20:35
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.

2 participants