feat: add Winston logging and Sarvam fallback provider - #56
Merged
Conversation
Replace all 115 console.* calls with a tagged Winston logger and
finish
wiring Sarvam as the fallback provider across every LLM path.
Logging (src/utils/logger.js):
- One base logger with tagged children: server, github, ai, worker,
queue,
db, auth, email, convex, redis. The tag identifies the subsystem, so
call
sites no longer hand-write "[LLM]"-style prefixes into their
messages.
- AI lines carry the provider as a field (ai:Gemini, ai:Sarvam), so a
fallback run reads as one provider failing and the other succeeding.
- Structured meta instead of interpolated prose: repo, commit, path,
provider, durationMs, status.
- Readable lines in development, JSON in production, level via
LOG_LEVEL.
- Log uncaught exceptions and unhandled rejections.
- Add per-request logging middleware (method, url, status, duration).
- Drop the full completion dump in ai.sdk.js to debug level; it was
printing every generated README to stdout.
Sarvam fallback:
- Route every Sarvam call through one method that checks for the API
key,
logs duration and failures, and rejects empty responses.
- Add cleanup() to SarvamProvider and fall back in
LlmService.cleanup().
- Pass a fallback provider into the patch pipeline, which previously
had
none and failed the run outright when Gemini was exhausted.
- Log the reason on every fallback; the catch blocks were swallowing
it.
Live updates:
- Rewrite the Convex live-update copy shown in the frontend: no vendor
names, no internal mode jargon, present-tense steps.
- Fire the patch pipeline's "rewriting sections" update before the
model
call rather than after it.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThe server adds Winston-based structured logging with tagged subsystem and provider loggers. It replaces console output across HTTP requests, integrations, AI workflows, repository workers, startup, error handling, and background processing. ChangesStructured logging rollout
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Express
participant requestLogger
participant RouteHandler
participant serverLog
Client->>Express: send HTTP request
Express->>requestLogger: enter middleware
requestLogger->>RouteHandler: call next()
RouteHandler->>serverLog: log application event
RouteHandler-->>Express: return response
Express-->>requestLogger: complete response
requestLogger->>serverLog: log status and duration
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Replace all 115 console.* calls with a tagged Winston logger and
finish
wiring Sarvam as the fallback provider across every LLM path.
Logging (src/utils/logger.js):
Sarvam fallback:
Live updates:
Summary by CodeRabbit
New Features
Bug Fixes