Name every session where the whole machine can see it - #7
Merged
Conversation
sessionRegistry() answers "which notebook owns this session" only inside the extension host that opened it. From anywhere else -- a second VS Code window, topaz, the dashboard we want next -- GemDB's sessions are anonymous gems, which is exactly when the question gets asked. So every login now publishes itself with System cacheName:, and file mode does the same in gemdb-run.tpz, because linked topaz never reaches session.ts and would otherwise sit in the cache as the stock 'TopazL'. Names read gemdb nb <notebook>, gemdb sh <pid>, gemdb ext, gemdb run <script>; a shell reports its pid because that is what leads back to the terminal, and only shells do, since in the extension host process.pid is the same number for every notebook. Chosen over a committed registry on purpose: this costs no commit and the entry dies with the process, where a registry would leak a row every time a window crashed and dirty a session to write one -- the Transcript bug class. The cost is a 31-character limit (32 raises OutOfRange, measured), so the name is a label and the sessionId stays the identifier. cacheNameFor truncates and strips non-ASCII rather than let a long notebook title fail a login. The GCI route does not exist for us and the headers say so: no GciInit equivalent in the thread-safe library, GciInitAppName "has no effect in remote GCI applications", GciSetCacheName_ does nothing when GciIsRemote. Recorded in CLAUDE.md with the descriptionOfSession: slots a dashboard needs, so nobody goes looking again. Verified: 108 unit tests (6 new on the naming rule, which has to be right without a database because it fails at login), and 45 integration tests -- one new, reading the names back the long way round through the shared cache from a different session and joining them to the sessionIds this side recorded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
sessionRegistry()answers "which notebook owns this session" only inside the extension host that opened it. From anywhere else — a second VS Code window, topaz, the administrator's dashboard we want next — GemDB's sessions are anonymous gems. That is exactly the situation in which someone asks the question.What each session is called
gemdb nb analysisgemdb sh 41234gemdb extgemdb backfill.pygemdb run backfillReadable by anything attached to the same cache, alongside the stock
GcReclaim,SymbolGemandTopazL:The
gemdbprefix earns its six characters on a database this extension did not install alone — it is the only thing saying which client a session belongs to. A shell reports its pid because a shell is its own process and that is what leads back to the terminal; only shells do, since in the extension hostprocess.pidis one number for every notebook.Two code paths, because file mode is not a GCI login
GciSession.logincovers notebooks, the extension and the shell. File mode does not go through it —gemdb file.pydrives linked topaz — sogemdb-run.tpzcarries its own copy and would otherwise show asTopazL. Yes, we generate that file:writeCliScriptsrewrites the wrapper and the driver on every staging.Why not a committed registry
System cacheName:writes shared memory, so it costs no commit, and the entry dies with the process — a window that crashes leaves nothing behind. A committed registry would leak a row on every crash and dirty a session to write one, which is theTranscriptbug class this project already paid for once.The price is a 31-character limit — 32 raises
OutOfRange(2061, measured). So the name is a label and the sessionId stays the identifier.cacheNameForstrips.ipynb(thenbtag already said it), drops non-ASCII (the cache holds 8-bit code points) and truncates, rather than letting a long notebook title fail a login on the notebook the user just opened.The GCI route does not exist for us
Worth recording, because it is the obvious place to look.
gcits.hf: there is noGciInitequivalent in the thread-safe library at all.GciInitAppName: "Has no effect in remote GCI applications" — it only picks the.conffilename.GciSetCacheName_: "IfGciIsRemote()returns TRUE, this function does nothing." The Smalltalk send is the only route that works. CLAUDE.md now says so, together with thedescriptionOfSession:slots a dashboard wants: 5 last begin/commit/abort, 16 commits behind this session's view, 8 holding the oldest commit record, 21 the client's pid (RPC only).This also corrects #5, which claimed GemStone offers no way to name a session.
Verification
sessionLimitMessagetakes its sessions as an argument.cacheStatisticsForAllSlots, then joins each name to the sessionId this side recorded at login — the join a dashboard needs.Not covered
Renames. The name is set at login, so a notebook saved under a new title keeps its old label until its session is reopened. Cheap to fix by re-sending on execute if it turns out to matter.
🤖 Generated with Claude Code