GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(session): support assistant message content updates by nexxeln · Pull Request #45015 · anomalyco/opencode

fix(session): support assistant message content updates #45015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
nexxeln merged 5 commits into v2 from message-content-update
Aug 26, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(session): support assistant message content updates #45015

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
a7364b0
fix(session): support assistant message content updates
nexxeln Aug 25, 2026
dd2e180
chore: remove unrelated generated documentation
nexxeln Aug 25, 2026
c81a5b5
fix(session): harden assistant content updates
nexxeln Aug 25, 2026
a4162b9
refactor(session): use specific message update errors
nexxeln Aug 26, 2026
0c4eb09
refactor(session): reuse message reference for updates
nexxeln Aug 26, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(session): harden assistant content updates
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@nexxeln
nexxeln committed Aug 25, 2026
commit c81a5b57a0d8108f7ea95554d737575d2a9d959a

There are no files selected for viewing

42 changes: 21 additions & 21 deletions 42 packages/client/src/effect/api/api.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -471,19 +471,6 @@ export type SessionLogOutput =
readonly location?: Location.Ref | undefined
readonly data: { readonly sessionID: Session.ID; readonly idle: number }
}
| {
readonly id: Event.ID
readonly created: number
readonly metadata?: { readonly [x: string]: unknown } | undefined
readonly type: "session.message.content.updated"
readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version }
readonly location?: Location.Ref | undefined
readonly data: {
readonly sessionID: Session.ID
readonly messageID: SessionMessage.ID
readonly content: ReadonlyArray<SessionMessage.AssistantContentEncoded>
}
}
| {
readonly id: Event.ID
readonly created: number
Expand Down Expand Up @@ -688,7 +675,7 @@ export type SessionLogOutput =
readonly assistantMessageID: SessionMessage.ID
readonly finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown"
readonly rawFinish?: string | undefined
readonly providerState?: { readonly [x: string]: unknown } | undefined
readonly providerState?: SessionMessage.ProviderState | undefined
readonly cost: number & Brand.Brand<"Money.USD">
readonly tokens: {
readonly input: number
Expand All @@ -713,7 +700,7 @@ export type SessionLogOutput =
readonly error: { readonly type: string; readonly message: string; readonly status?: number | undefined }
readonly finish?: "content-filter" | undefined
readonly rawFinish?: string | undefined
readonly providerState?: { readonly [x: string]: unknown } | undefined
readonly providerState?: SessionMessage.ProviderState | undefined
readonly cost?: (number & Brand.Brand<"Money.USD">) | undefined
readonly tokens?:
| {
Expand Down Expand Up @@ -752,7 +739,7 @@ export type SessionLogOutput =
readonly assistantMessageID: SessionMessage.ID
readonly ordinal: number
readonly text: string
readonly state?: { readonly [x: string]: unknown } | undefined
readonly state?: SessionMessage.ProviderState | undefined
}
}
| {
Expand All @@ -766,7 +753,7 @@ export type SessionLogOutput =
readonly sessionID: Session.ID
readonly assistantMessageID: SessionMessage.ID
readonly ordinal: number
readonly state?: { readonly [x: string]: unknown } | undefined
readonly state?: SessionMessage.ProviderState | undefined
}
}
| {
Expand All @@ -781,7 +768,7 @@ export type SessionLogOutput =
readonly assistantMessageID: SessionMessage.ID
readonly ordinal: number
readonly text: string
readonly state?: { readonly [x: string]: unknown } | undefined
readonly state?: SessionMessage.ProviderState | undefined
}
}
| {
Expand Down Expand Up @@ -825,7 +812,7 @@ export type SessionLogOutput =
readonly id: string
readonly input: { readonly [x: string]: unknown }
readonly executed: boolean
readonly state?: { readonly [x: string]: unknown } | undefined
readonly state?: SessionMessage.ProviderState | undefined
}
}
| {
Expand Down Expand Up @@ -861,7 +848,7 @@ export type SessionLogOutput =
]
readonly metadata?: { readonly [x: string]: Schema.Json } | undefined
readonly executed: boolean
readonly resultState?: { readonly [x: string]: unknown } | undefined
readonly resultState?: SessionMessage.ProviderState | undefined
}
}
| {
Expand Down Expand Up @@ -900,7 +887,7 @@ export type SessionLogOutput =
| undefined
readonly metadata?: { readonly [x: string]: Schema.Json } | undefined
readonly executed: boolean
readonly resultState?: { readonly [x: string]: unknown } | undefined
readonly resultState?: SessionMessage.ProviderState | undefined
}
}
| {
Expand Down Expand Up @@ -987,6 +974,19 @@ export type SessionLogOutput =
readonly location?: Location.Ref | undefined
readonly data: { readonly sessionID: Session.ID; readonly to: SessionMessage.ID }
}
| {
readonly id: Event.ID
readonly created: number
readonly metadata?: { readonly [x: string]: unknown } | undefined
readonly type: "session.message.content.updated"
readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version }
readonly location?: Location.Ref | undefined
readonly data: {
readonly sessionID: Session.ID
readonly messageID: SessionMessage.ID
readonly content: ReadonlyArray<SessionMessage.AssistantContentEncoded>
}
}
| {
readonly id: Event.ID
readonly created: number
Expand Down
128 changes: 64 additions & 64 deletions 128 packages/client/src/promise/generated/types.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ export type InstructionEntryKey = string

export type SessionGenerateResponse = { data: { text: string } }

export type SessionMessageProviderState1 = { [x: string]: any }

export type SessionMessageToolStateRunning1 = {
status: "running"
input: { [x: string]: any }
metadata: { [x: string]: JsonValue }
}

export type ToolFileContent1 = { type: "file"; uri: string; mime: string; name?: string | undefined }

export type SessionInboxSyntheticPayload1 = { text: string; description?: string; metadata?: { [x: string]: any } }

export type ShellInfo = {
Expand All @@ -180,6 +170,16 @@ export type ShellInfo = {
time: { started: number; completed?: number }
}

export type SessionMessageProviderState1 = { [x: string]: any }

export type ToolFileContent1 = { type: "file"; uri: string; mime: string; name?: string | undefined }

export type SessionMessageToolStateRunning1 = {
status: "running"
input: { [x: string]: any }
metadata: { [x: string]: JsonValue }
}

export type EventLogSynced = { type: "log.synced"; aggregateID: string; seq?: number }

export type SessionInterruptResponse = { interrupted: boolean }
Expand Down Expand Up @@ -1179,13 +1179,37 @@ export type McpResourcesChanged = {
data: { server: string }
}

export type SessionMessageAssistantText1 = { type: "text"; text: string; state?: SessionMessageProviderState1 }
export type SessionShellStarted = {
id: string
created: number
metadata?: { [x: string]: any }
type: "session.shell.started"
durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef
data: { sessionID: string; shell: ShellInfo }
}

export type SessionMessageAssistantReasoning1 = {
type: "reasoning"
text: string
state?: SessionMessageProviderState1
time?: { created: number; completed?: number }
export type SessionShellEnded = {
id: string
created: number
metadata?: { [x: string]: any }
type: "session.shell.ended"
durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef
data: {
sessionID: string
shell: ShellInfo
output: { output: string; cursor: number; size: number; truncated: boolean }
}
}

export type ShellCreated = {
id: string
created: number
metadata?: { [x: string]: any }
type: "shell.created"
location?: LocationRef
data: { info: ShellInfo }
}

export type SessionStepEnded = {
Expand Down Expand Up @@ -1288,40 +1312,16 @@ export type SessionToolCalled = {
}
}

export type ToolContent1 = ToolTextContent | ToolFileContent1

export type SessionShellStarted = {
id: string
created: number
metadata?: { [x: string]: any }
type: "session.shell.started"
durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef
data: { sessionID: string; shell: ShellInfo }
}
export type SessionMessageAssistantText1 = { type: "text"; text: string; state?: SessionMessageProviderState1 }

export type SessionShellEnded = {
id: string
created: number
metadata?: { [x: string]: any }
type: "session.shell.ended"
durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef
data: {
sessionID: string
shell: ShellInfo
output: { output: string; cursor: number; size: number; truncated: boolean }
}
export type SessionMessageAssistantReasoning1 = {
type: "reasoning"
text: string
state?: SessionMessageProviderState1
time?: { created: number; completed?: number }
}

export type ShellCreated = {
id: string
created: number
metadata?: { [x: string]: any }
type: "shell.created"
location?: LocationRef
data: { info: ShellInfo }
}
export type ToolContent1 = ToolTextContent | ToolFileContent1

export type ModelCompatibility = {
reasoningField?: ModelReasoningField
Expand Down Expand Up @@ -1690,21 +1690,6 @@ export type SessionForked = {
}
}

export type SessionMessageToolStateCompleted1 = {
status: "completed"
input: { [x: string]: any }
content: [ToolContent1, ...Array<ToolContent1>]
metadata?: { [x: string]: JsonValue }
}

export type SessionMessageToolStateError1 = {
status: "error"
input: { [x: string]: any }
error: SessionStructuredError
content?: [ToolContent1, ...Array<ToolContent1>]
metadata?: { [x: string]: JsonValue }
}

export type SessionToolSuccess = {
id: string
created: number
Expand Down Expand Up @@ -1742,6 +1727,21 @@ export type SessionToolFailed = {
}
}

export type SessionMessageToolStateCompleted1 = {
status: "completed"
input: { [x: string]: any }
content: [ToolContent1, ...Array<ToolContent1>]
metadata?: { [x: string]: JsonValue }
}

export type SessionMessageToolStateError1 = {
status: "error"
input: { [x: string]: any }
error: SessionStructuredError
content?: [ToolContent1, ...Array<ToolContent1>]
metadata?: { [x: string]: JsonValue }
}

export type ModelInfo = {
id: string
modelID: string
Expand Down Expand Up @@ -2121,7 +2121,6 @@ export type SessionEventDurable =
| SessionMoved
| SessionRenamed
| SessionViewed
| SessionMessageContentUpdated
| SessionDeleted
| SessionForked
| SessionInboxDelivered
Expand Down Expand Up @@ -2156,6 +2155,7 @@ export type SessionEventDurable =
| SessionRevertStaged
| SessionRevertCleared
| SessionRevertCommitted
| SessionMessageContentUpdated
| SessionUsageRecorded

export type IntegrationInfo = {
Expand All @@ -2177,7 +2177,6 @@ export type V2Event =
| SessionMoved
| SessionRenamed
| SessionViewed
| SessionMessageContentUpdated
| SessionUsageUpdated
| SessionDeleted
| SessionForked
Expand Down Expand Up @@ -2218,6 +2217,7 @@ export type V2Event =
| SessionRevertStaged
| SessionRevertCleared
| SessionRevertCommitted
| SessionMessageContentUpdated
| FilesystemChanged
| ReferenceUpdated
| PermissionAsked
Expand Down
19 changes: 14 additions & 5 deletions 19 packages/client/src/solid/data.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ function createSync() {
has(key: string) {
return state.has(key)
},
pending(key: string) {
const active = state.get(key)
return active !== undefined && active !== true
},
invalidate(key?: string) {
if (key) {
const active = state.get(key)
Expand Down Expand Up @@ -705,12 +709,17 @@ export function createData(config: CreateDataInput) {
match.time.completed = event.created
})
return
case "session.message.content.updated":
message.update(event.data.sessionID, (draft, index) => {
const assistant = message.assistant(draft, index, event.data.messageID)
if (assistant) assistant.content = [...event.data.content]
})
case "session.message.content.updated": {
if (store.session.message[event.data.sessionID])
message.update(event.data.sessionID, (draft, index) => {
const assistant = message.assistant(draft, index, event.data.messageID)
if (assistant) assistant.content = [...event.data.content]
})
if (!sync.pending(`session.message:${event.data.sessionID}`)) return
result.session.message.invalidate(event.data.sessionID)
void result.session.message.sync(event.data.sessionID)
return
}
case "session.step.started":
message.update(event.data.sessionID, (draft, index) => {
const position = index.get(event.data.assistantMessageID)
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.