Repository navigation
fix(events): refuse an empty session id - #801
Draft
justintime4tea wants to merge 1 commit into
Draft
justintime4tea wants to merge 1 commit into
justintime4tea wants to merge 1 commit into
Conversation
|
justintime4tea
force-pushed
the
justingross/GH-800-session-id-refuses-empty
branch
from
October 9, 2026 13:10
412cd98 to
7022782
Compare
justintime4tea
force-pushed
the
justingross/GH-778-run-events-carry-lifecycle-and-activity
branch
from
October 9, 2026 14:25
cba59a3 to
245e703
Compare
justintime4tea
force-pushed
the
justingross/GH-800-session-id-refuses-empty
branch
from
October 9, 2026 14:26
7022782 to
d23fd02
Compare
`SessionId` was generated by `string_newtype!`, so `""` built one and deserialized into one, while `ObserverId`, `CheckpointRef` and `RunId` refuse their empty and nil values. Every store keyed by session inherited the hole: clients sending a blank chat session id shared one skill log, and a session journal keyed by it would be shared by every run whose id resolved to a blank. `SessionId` now comes from `nonempty_string_newtype!`: `new` returns a `Result`, `TryFrom` replaces `From`, and `""` is refused on every path. The macro gains `non_empty`, for a boundary where a blank and an absent value mean the same, and every site that built a session from a string decides what a blank means there, which is the same thing everywhere: no session. The chat handler's resolver hands out a `SessionId`, so the guarantee travels with the value; the builder's and the orchestrator's HITL scopes, and a stored approval's scope on restore, read a blank as `None`; the standalone CLI reports one as an error at its boundary. Fixes: GH-800
justintime4tea
force-pushed
the
justingross/GH-778-run-events-carry-lifecycle-and-activity
branch
from
October 9, 2026 20:52
245e703 to
5db77be
Compare
justintime4tea
force-pushed
the
justingross/GH-800-session-id-refuses-empty
branch
from
October 9, 2026 20:52
d23fd02 to
17ddf89
Compare
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.
Summary
SessionIdaccepted the empty string, and every store keyed by session inherited it (#800): clients sending a blank chat session id shared one skill log, and a session journal (#779) keyed by a blank would be shared by every run whose id resolved to one. This movesSessionIdontononempty_string_newtype!so a blank cannot be held at all, and has each boundary that built one from a string treat a blank as "no session"."Stacked" on #794 — draft until it lands
This builds on
nonempty_string_newtype!from #794, so its base is #794's branch. The typed resolver builds on #795 (treat a blank chat session id as missing), which has merged intonightly; the branch is rebased onto #794 at the currentnightlyand no longer carries its own copy.When #794 merges: retarget to
nightly, mark ready.Changes
aura-events:SessionIdis generated bynonempty_string_newtype!—newreturnsResult<Self, EmptyId>,TryFromreplacesFrom,""fails to deserialize. The macro gainsnon_empty(value) -> Option<Self>for boundaries where blank and absent mean the same.chat_session_id()returns aSessionId(blank sources still fall through, a fresh id is minted if none), andprepare_requesttakes&SessionId, so the guarantee travels with the value.ScopeRecord → AgentScopeon restoring a stored approval: a blank reads asNonerather than a session or a decode failure.direct.rs): a blank session id is an error at the boundary; theBackendtrait keeps its&str.non_empty, a blank in a stored scope restoring asNone, and the existing resolver and skill-log tests under the typed id.