Skip to content

feat(eve): fix the remaining 0.30 event gaps and correlate traces - #506

Merged
HugoRCD merged 3 commits into
mainfrom
evl-eve-gaps
Aug 7, 2026
Merged

feat(eve): fix the remaining 0.30 event gaps and correlate traces#506
HugoRCD merged 3 commits into
mainfrom
evl-eve-gaps

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Aug 6, 2026

Copy link
Copy Markdown
Owner

🔗 Linked issue

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • New Features

    • Added optional OpenTelemetry instrumentation for correlating eve traces with evlog events.
    • Added support for capturing reasoning summaries, response details, structured results, request IDs, and session IDs.
    • Added configurable message capture, trace setup, session events, and model cost fallback behavior.
    • Preserved existing behavior when instrumentation is not configured.
  • Bug Fixes

    • Updated refund approval handling to use supported framework decision values.
  • Documentation

    • Expanded eve integration guidance, configuration details, supported message modes, and trace correlation instructions.
    • Updated the eve version requirement.

@HugoRCD HugoRCD self-assigned this Aug 6, 2026
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 088db35

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
evlog Minor
@evlog/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-telemetry Ready Ready Preview Aug 7, 2026 7:49am
4 Skipped Deployments
Project Deployment Actions Updated (UTC)
evi Skipped Skipped Aug 7, 2026 7:49am
evlog-docs Skipped Skipped Aug 7, 2026 7:49am
evlog-render-lab Skipped Skipped Aug 7, 2026 7:49am
just-use-evlog Skipped Skipped Aug 7, 2026 7:49am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Eve integration

Layer / File(s) Summary
Turn metadata capture
packages/evlog/src/eve/index.ts, packages/evlog/test/eve.test.ts
Tracks reasoning sizes, response lengths and capture modes, and structured results. Tests cover the new event handling.
Eve span instrumentation
packages/evlog/src/eve/index.ts, packages/evlog/test/eve.test.ts, .changeset/eve-close-remaining-gaps.md
Adds defineEvlogInstrumentation() with optional setup, configuration forwarding, and turn/session span correlation.
Integration and example updates
apps/docs/content/5.use-cases/5.eve.md, packages/evlog/README.md, examples/eve/..., examples/eve/package.json
Documents Eve 0.30 integration, message modes, instrumentation, and metadata. Updates the example dependency and approval hook.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EveTurn
  participant Evlog
  participant AISDKSpan
  EveTurn->>Evlog: emit reasoning, message, and result events
  Evlog->>Evlog: accumulate turn metadata
  EveTurn->>AISDKSpan: start model-call span
  Evlog->>AISDKSpan: attach request and session IDs
  Evlog->>EveTurn: write wide-event metadata
Loading

Possibly related PRs

Suggested labels: feature

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description repeats the template but provides no change details, linked issue, rationale, or completed checklist items. Add a summary of the Eve 0.30 fixes and trace correlation, explain the motivation, link an issue if applicable, and mark the documentation checklist item.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, uses the required conventional commit format, and clearly describes the Eve integration changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch evl-eve-gaps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/5.use-cases/5.eve.md`:
- Line 211: Update the correlation claim near defineEvlogInstrumentation to
require telemetry configuration that includes runtimeContext, such as
telemetry.includeRuntimeContext, before stating that model-call spans and their
children carry evlog.request_id and evlog.session_id; otherwise narrow the
wording to spans explicitly configured to include it.

In `@examples/eve/package.json`:
- Line 34: Regenerate pnpm-lock.yaml to match the dependency declared by
examples/eve/package.json: add the examples/eve importer and the resolved
eve@0.30.8 package entry, preserving the existing lockfile structure and
integrity metadata.

In `@packages/evlog/README.md`:
- Line 595: Update the prose sentence describing defineEvlogHook() in the README
to replace “lifecycle” with “life cycle,” preserving the existing meaning and
all other wording.

In `@packages/evlog/src/eve/index.ts`:
- Around line 706-716: Update the comments surrounding the reasoning and
response logging in the response-processing code to use factual, plain wording:
state that only reasoning size metrics are logged, never reasoning content, and
directly describe when response length is captured and how response text is
handled. Preserve the existing logging behavior and modify comments only.

In `@packages/evlog/test/eve.test.ts`:
- Around line 69-71: Update the runTurn test fixture around result.completed to
derive the result type from HookEventMap and pass it directly without casting
options.result to never. Keep runTurn type-checked against result.completed so
incompatible Eve options are detected.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: de3efcd7-f230-4a71-a38b-2187ef313cf4

📥 Commits

Reviewing files that changed from the base of the PR and between 0b136f2 and dda4d00.

⛔ Files ignored due to path filters (2)
  • packages/evlog/test/toolkit/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .changeset/eve-close-remaining-gaps.md
  • apps/docs/content/5.use-cases/5.eve.md
  • examples/eve/agent/instrumentation.ts
  • examples/eve/agent/tools/issue_refund.ts
  • examples/eve/package.json
  • packages/evlog/README.md
  • packages/evlog/src/eve/index.ts
  • packages/evlog/test/eve.test.ts

Comment thread apps/docs/content/5.use-cases/5.eve.md
Comment thread examples/eve/package.json
Comment thread packages/evlog/README.md
Comment thread packages/evlog/src/eve/index.ts Outdated
Comment thread packages/evlog/test/eve.test.ts Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 7, 2026 07:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 7, 2026 07:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evi August 7, 2026 07:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 7, 2026 07:47 Inactive
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@506
npm i https://pkg.pr.new/evlog@506
npm i https://pkg.pr.new/@evlog/nuxthub@506
npm i https://pkg.pr.new/@evlog/telemetry@506

commit: 088db35

@HugoRCD
HugoRCD merged commit f8fb677 into main Aug 7, 2026
19 of 20 checks passed
@HugoRCD
HugoRCD deleted the evl-eve-gaps branch August 7, 2026 07:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/evlog/src/eve/index.ts (3)

1415-1419: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Remove the private implementation JSDoc.

buildInstrumentationContext is private. This comment only repeats behavior expressed by the function and its return type. Keep JSDoc on the public interface and factory. (github.com)

As per coding guidelines, use comments only for constraints not expressible in code; do not paraphrase or narrate implementation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/evlog/src/eve/index.ts` around lines 1415 - 1419, Remove the private
implementation JSDoc immediately above buildInstrumentationContext, while
preserving JSDoc on the public interface and factory.

Source: Coding guidelines


1158-1187: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve zero-length response metadata.

An empty message.completed value is valid. The handler records message.length as zero, and the flush condition then drops the response metadata. Track presence separately and add the regression test. (github.com)

  • packages/evlog/src/eve/index.ts#L1158-L1187: set a response-present flag for every non-null message.
  • packages/evlog/src/eve/index.ts#L716-L723: flush when the flag is set, not only when responseChars is positive.
  • packages/evlog/test/eve.test.ts#L676-L731: assert { responseChars: 0, response: '' } in full message mode.

As per coding guidelines, bug fixes require a failing regression test before the fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/evlog/src/eve/index.ts` around lines 1158 - 1187, Preserve metadata
for empty responses by first adding a failing regression assertion in
packages/evlog/test/eve.test.ts lines 676-731 for full message mode expecting
responseChars: 0 and response: ''. In packages/evlog/src/eve/index.ts lines
1158-1187, have the message.completed handler mark response presence for every
non-null message, including empty strings; then update the flush condition at
lines 716-723 to use that presence flag instead of requiring responseChars to be
positive.

Source: Coding guidelines


170-174: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Preserve the result.completed type contract.

TurnAccumulator.result is written from event.data.result in result.completed, but it is declared as result?: unknown; the Eve fixture already types this as HookEventMap['result.completed']['data']['result']. Use that Eve result type or a local alias so eve.result keeps the structured result shape.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/evlog/src/eve/index.ts` around lines 170 - 174, Update the
TurnAccumulator result field to use the structured result type from
HookEventMap['result.completed']['data']['result'] (or a local alias), instead
of unknown, while preserving its optionality and the existing result.completed
assignment flow.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/evlog/src/eve/index.ts`:
- Around line 1415-1419: Remove the private implementation JSDoc immediately
above buildInstrumentationContext, while preserving JSDoc on the public
interface and factory.
- Around line 1158-1187: Preserve metadata for empty responses by first adding a
failing regression assertion in packages/evlog/test/eve.test.ts lines 676-731
for full message mode expecting responseChars: 0 and response: ''. In
packages/evlog/src/eve/index.ts lines 1158-1187, have the message.completed
handler mark response presence for every non-null message, including empty
strings; then update the flush condition at lines 716-723 to use that presence
flag instead of requiring responseChars to be positive.
- Around line 170-174: Update the TurnAccumulator result field to use the
structured result type from HookEventMap['result.completed']['data']['result']
(or a local alias), instead of unknown, while preserving its optionality and the
existing result.completed assignment flow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a6539fb0-5625-4b37-934e-823a1c991681

📥 Commits

Reviewing files that changed from the base of the PR and between dda4d00 and 088db35.

📒 Files selected for processing (2)
  • packages/evlog/src/eve/index.ts
  • packages/evlog/test/eve.test.ts

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.

1 participant