Repository navigation
refactor(ai): reuse formatTelemetryError and the recordModel resolution - #800
Merged
Merged
Conversation
recordError resolved the provider and model a second time to build the stepsUsage entry, and the error message expression was repeated in three places in the AI logger. recordModel now returns the resolved pair, and the two error-message sites call formatTelemetryError like the other call sites already do. Behavior is unchanged.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Contributor
|
Thank you for following the naming conventions! 🙏 |
@evlog/cli
evlog
@evlog/nuxthub
@evlog/signals
@evlog/telemetry
commit: |
This branch was successfully deployed
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
Dedupe batch from the 2026-10-09 simplification sweep (revision
a34dffd),packages/evlog/src/ai/index.ts, findings code-1 and code-2.recordErrorresolved the provider and model a second time to build itsstepsUsageentry.recordModelnow returns the pair it resolves, andrecordErrorreuses it.error instanceof Error ? error.message : String(error)expression is repeated at two sites. Both now callformatTelemetryError, which already holds that exact expression and is already used by the integration.Behavior is unchanged. No changeset: this is an internal refactor with no consumer-visible change.
Evidence
Checks, run in
/workspace/repoat0ce5885(sandbox cache enabled, read-only):pnpm --filter evlog exec vitest run test/ai: 103 of 103 passed.pnpm --filter evlog exec vitest run: 96 files, 2014 of 2014 tests passed.pnpm --filter evlog run lint: exit 0.pnpm --filter evlog run build: exit 0. That package'stypecheckscript isecho 'Typecheck handled by build', so the build is the typecheck.tsc --noEmit -p packages/evlog/tsconfig.json: reports errors only in test files and other source files, none insrc/ai/index.ts. That tsconfig includes the test directory. I did not run it onmainfor a baseline comparison.ELI5
The AI logger had two spots that did the same small job twice: one that figured out the model name a second time, and one that turned an error into text in three places. This change does each job once and reuses the result. What gets logged stays exactly the same.