Repository navigation
feat(openrouter): tag client log lines with the review phase - #120
Merged
Merged
Conversation
requestReview now takes the caller's logger, and the prompted strategy passes a child bound to the phase id. Every attempt, fallback-advance, ceiling-retry, acceptance, cost-lookup, and late-settlement line the client logs carries `phase`, so concurrent parallel phases on the same model can be told apart. The client factory no longer takes a logger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
umm-actually re-reviewed at 1 new finding(s) posted (1 tracked finding(s) across all runs). umm-actually · deepseek/deepseek-v4.1-flash |
- withDeadline takes its operation context from a child logger instead of a parallel logContext record; the log output is unchanged. - requestReview takes its type from OpenRouterClient instead of repeating the params shape. - createPromptedGenerateFindings builds the phase logger once and derives its own module-tagged line from it; the comment now gives the real reason client lines skip the module tag. - Doc comments explain the late-settlement line, the logger-free factory, attemptOnce's logging, and drop an undefined roadmap reference. Ship-Check: code-quality · claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rejection The "requesting review" line had no assertion, so a change to how its phase and module tags are bound could pass the suite. It is now pinned whole. The late-settlement test asserts the ladder-exhaustion message instead of only the error class. Two multiline client test callbacks get block bodies, and the stub queue guard is a truthy check. Ship-Check: test-audit · claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o doc claims The cost-lookup failure warnings logged through the request logger, so they carried no generationId while the lookup's deadline lines did. All lookup lines now go through one child logger that binds it. withDeadline's doc said it logs only timing, but it also logs how the abandoned call settled. createPromptedGenerateFindings's doc said one request, but the client's retry and fallback ladder can send several. Ship-Check: bug-check · claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equest log The requesting-review line already carries the phase and an auto-captured source file, so the manual module tag added nothing and needed a comment explaining why client lines lack it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
With
phases: parallel, three review phases call the same model at the same time. Until now, the OpenRouter client's log lines carried the model but no phase. A failed attempt, a fallback advance, or a request that settled after its deadline could not be tied to the phase that sent it.generationIdonly appears on accepted responses, so it doesn't help with failures.Every line the client logs for a phase now carries
phase: <id>. This includes the late-settlement line, which is logged afterrequestReviewhas already returned.Changes
src/openrouter/client.tsrequestReview(params, logger)takes the caller's logger, andcreateOpenRouterClientno longer takes one.attemptOnceandlookupGenerationCostpasswithDeadlinea child of that logger. The child binds the operation (operationplusmodelorgenerationId), sowithDeadlineno longer takes a separatelogContextrecord.generationIdas well.review attempt failedadvancing to fallback model without same-model retryretrying with an output ceiling…review response acceptedrequest deadline elapseddeadline-elapsed request settledgeneration cost lookup failed(two sites)unexpected generation response shapesrc/orchestrate.tscreatePromptedGenerateFindingsbuildslogger.child({ phase })for each call and passes it torequestReview.requesting reviewline logs through the same phase logger. The hand-setmodule: "generateFindings"tag on that line is gone, because the auto-capturedsourcefield already names the file.src/main.ts: builds the client without a logger.Tests
requestReviewcall passes the same captured logger its assertions read.deadline-elapsed request settledafter the request has already rejected. The test also asserts the exact rejection message.createPromptedGenerateFindingstests:phase.requesting reviewline is asserted whole:phase,model, andfallbackModel.generationId.parallelintegration test with the real client:correctness-security) fails once with a retryable 500.review attempt failedline names that phase.review response acceptedlines name their own phase.ab4f290, and the last three ran after the logger-context refactor:subtle-bugsrequesting reviewthrough the unscoped loggerrequesting reviewtest (missingphase)withDeadlinethe plain logger instead of the chat-request childwithDeadlinethe plain logger instead of the cost-lookup childVerification
npm test: 804 passednpm run lintandnpm run buildare clean, anddocker build .succeeds.combined, and its log showsreview response acceptedwith"phase":"combined"and"source":"client.js:…".🤖 Generated with Claude Code