Skip to content

Record nothing for a call or a session a save carried into a later start - #422

Merged
Gabriel-Darbord merged 3 commits into
mainfrom
a-call-across-a-save-records-nothing
Nov 23, 2026
Merged

Gabriel-Darbord merged 3 commits into
mainfrom
a-call-across-a-save-records-nothing

Conversation

@Gabriel-Darbord

@Gabriel-Darbord Gabriel-Darbord commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Saving the image saves the tool calls running, and every start of the saved image resumes them: a call that saves and quits the image, as Smalltalk snapshot: true andQuit: true does, finished again in each later start. The OpenTelemetry backend dropped a span when it had been configured in an earlier image session, but a start configures it again before the call resumes, most often with the same settings, so the check passed. The span was exported once per start, with the same trace and span ids, an unset status and the downtime as its duration, and the call's metric points, local log line, trace record and counts were recorded with it.

A tool call record now knows the image session it started in (MCPToolCallRecord>>imageSession, startedInAnEarlierImageSession), and a call that started before the image last started records nothing when it ends, whatever the settings: the local backend neither counts, logs nor traces it, and the OpenTelemetry backend drops its span unended and records no metric point. A record made without its session, as the call that loads this code over an older MCP has, is recorded as before.

A call that begins and ends in one session is unaffected. One that saves without quitting, as Smalltalk saveSession does, ends in the saving session, which records it once; only the later starts of the saved file record nothing for it. The call that saves and quits is not recorded at all: the image quits right after writing the snapshot and runs nothing more, so the call never ends. Ending its span before the save, from a shutdown handler, would report an outcome and a duration the call does not have, and would end every other call running at the quit as though it had succeeded.

A server running when the image is saved goes on in each start of the saved image until it is stopped there, and stopping it emitted mcp.session.end and wrote the session's end to the local resource file, once per start, for a session another image session began. The backend now knows the image session its session started in (MCPLocalObservabilityBackend>>sessionStartedInAnEarlierImageSession), and such a session ends without either, as a call does. The servers running when this code is loaded count as started in the image session of the load, so an image upgraded in place and then saved is covered too.

Log records queued and metric points recorded before a save were also exported again by every start, through the providers a start replaces and shuts down. Gabriel-Darbord/opentelemetry-pharo#24 drops them at the start and has a quitting image send them within a second. It also stops a meter provider from keeping every measurement for as long as the image runs, which grew a headless server's memory with every call, and from sending empty metrics requests. MCP now loads its release, v1.3.2.

Gabriel-Darbord and others added 2 commits November 23, 2026 00:43
A tool call record now knows the image session it started in, and a call that started before the image last started records nothing when it ends: no span, no metric point, no local log line, trace record or count. Saving the image saves the calls running, so every start of the saved file finished the call that saved it again, and its span was sent once per start with the downtime as its duration, since the start configured the backend again from the same settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A server running when the image is saved goes on in each start of the saved image until it is stopped there, and stopping it emitted mcp.session.end and wrote the session's end locally, once per start, for a session another image session began. Such a session now ends without either, as a call carried across a save does. The servers running when this is loaded count as started in the image session of the load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Gabriel-Darbord
Gabriel-Darbord force-pushed the a-call-across-a-save-records-nothing branch from 8660bb7 to 6aa31d1 Compare November 23, 2026 00:15
It drops the log records and metric points a saved image held when the image starts again, which every start of the saved file exported again, and a quitting image sends them within a second. A meter provider keeps a measurement only until its readers have collected it, rather than for as long as the image runs, and no empty metrics request is sent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Gabriel-Darbord Gabriel-Darbord changed the title Record nothing for a call a save carried into a later start Record nothing for a call or a session a save carried into a later start Nov 23, 2026
@Gabriel-Darbord
Gabriel-Darbord merged commit 7b7c69d into main Nov 23, 2026
6 checks passed
@Gabriel-Darbord
Gabriel-Darbord deleted the a-call-across-a-save-records-nothing branch November 23, 2026 00:27
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