Skip to content

Refactor v2 session events as schemas#24512

Open
thdxr wants to merge 22 commits intodevfrom
refactor/session-event-schema-definitions
Open

Refactor v2 session events as schemas#24512
thdxr wants to merge 22 commits intodevfrom
refactor/session-event-schema-definitions

Conversation

@thdxr
Copy link
Copy Markdown
Member

@thdxr thdxr commented Apr 26, 2026

Summary

  • Rework v2 session events from schema classes into const schema definitions with session.* event types and sync metadata.
  • Add shared prompt attachment schemas and update session entry projection/stepper matching for the new prompted event shape.
  • Simplify session-entry-stepper tests by removing FastCheck and custom adapter coverage in favor of deterministic memory reducer cases.

Tests

  • bun typecheck from packages/opencode
  • bun test test/session/session-entry-stepper.test.ts from packages/opencode
  • push hook: bun turbo typecheck

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@thdxr thdxr force-pushed the refactor/session-event-schema-definitions branch 2 times, most recently from d723f1e to 8bf098c Compare April 27, 2026 20:02
@thdxr thdxr added the beta label Apr 27, 2026
@thdxr thdxr force-pushed the refactor/session-event-schema-definitions branch from a1118de to c11cb8f Compare April 28, 2026 22:36
thdxr added 11 commits April 28, 2026 22:38
Removed the @effect/language-service dependency from packages/opencode and packages/core
to simplify the build and reduce unnecessary complexity.

Refactored tool output handling to use a structured content array instead of flat fields.
This enables richer tool responses with mixed content types (text, files) and better
structured data support for future extensibility.
Prevents runtime errors by ensuring undefined attachments are converted to an empty array before spreading into the message parts. This fixes scenarios where tool responses without attachments would cause the session processor to fail.
…try details from appearing in the conversation history
Eliminates the dependency on LegacySession from the v2 HTTP API,
simplifying the handler initialization by only using SessionV2.
Also exports defaultLayer from SessionV2 for consistent layer provisioning.
@thdxr thdxr force-pushed the refactor/session-event-schema-definitions branch from a4febcb to 53f212c Compare April 29, 2026 02:38
…ined

When context window overflows, users now see a summary of what was
retained instead of just a generic compaction notice. This helps users
understand why certain parts of the conversation may no longer be
immediately accessible and what key information was preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant