Skip to content

Commit 0983235

Browse files
committed
core: simplify Session.Info schema to empty struct for flexible event handling
This change removes the predefined fields from Session.Info to allow more dynamic event-driven session data. Instead of fixed schema fields, session information will be populated through the event system, enabling better support for evolving session states without schema migrations. The empty struct serves as a base that can be extended through the event model, making it easier to add new session attributes without modifying core schema definitions.
1 parent 6d1fa44 commit 0983235

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

packages/opencode/src/v2/session.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,7 @@ export type Delivery = Schema.Schema.Type<typeof Delivery>
1717

1818
export const DefaultDelivery = "immediate" satisfies Delivery
1919

20-
export const Info = Schema.Struct({
21-
id: SessionID,
22-
slug: Schema.String,
23-
projectID: ProjectID,
24-
workspaceID: optionalOmitUndefined(WorkspaceID),
25-
directory: Schema.String,
26-
path: optionalOmitUndefined(Schema.String),
27-
parentID: optionalOmitUndefined(SessionID),
28-
summary: optionalOmitUndefined(Summary),
29-
share: optionalOmitUndefined(Share),
30-
title: Schema.String,
31-
version: Schema.String,
32-
time: Time,
33-
permission: optionalOmitUndefined(Permission.Ruleset),
34-
revert: optionalOmitUndefined(Revert),
35-
}).annotate({ identifier: "Session" })
20+
export const Info = Schema.Struct({}).annotate({ identifier: "Session" })
3621

3722
export interface Interface {
3823
readonly list: (input: {

0 commit comments

Comments
 (0)