Repository navigation
Replies: 1 comment
|
Version-0 rows are accepted; they simply carry no name. nativeCatalogFact() special-cases only version: 3 and defers everything else to catalogFact(), which admits v0/v1/v2 (session-format-v3-to-v4/src/facts.ts:72-84). The projection then drops version and spreads the descriptor (dsh-subagent/src/catalog.ts:120-127), so the wire entry has mode and label but no name. Every addressing surface degrades as you describe: joinAgentPath() returns undefined as soon as one link is unnamed (names.ts:33-36), and agentAddress() falls back to the Session id (names.ts:44-47). One row per child is enforced by the format, not the projection. assertReleasedV4Relationships() keeps a per-catalog Set of childIds and throws duplicate catalog child …; duplicate sibling names are rejected by the same pass (session-format-v3-to-v4/src/validation.ts:123-132), and the V3→V4 migration carries the same guard (migration.ts:145). So a second row for an existing child can never be the rename mechanism — you would trade an unnamed child for an unopenable session, which is exactly what you measured. Two viable shapes, and I would do both, in this order: Derive the name in the projection view. For rows with version < 3, synthesize a name as a pure function of the catalog rows in seq order: slugify label (lower-case, [a-z0-9-], ≤32, never lead), fall back to child-N, suffix -2, -3… on collision, reserving against names already present in v3 rows. catalogOf already reads wire.view (dsh-subagent/src/index.ts:223) and reserveName() consumes catalogNames(catalogOf(...)) (manager.ts:532-534), so a derived name is automatically treated as taken and a later child cannot claim it. Keeping the rule in view rather than in the fold state also avoids a checkpoint change: the projection stores head rows under stateVersion: 6, so there is no state bump and no cache invalidation. list_agents, the panel, send_message targets and descendant paths start working, and resolveAgentPath() needs no change because it matches on entry.name. A supported offline repair for durable names. Derivation is deterministic but it is not a choice: a user who wants a specific name still needs the rewrite you did by hand. That belongs in a backed-up, idempotent command that refuses a sibling collision and re-runs the shipped verifier before replacing a log. One question back: for a v0 one-shot child whose label is absent, is child-N acceptable in your tree, or would you rather see a short id prefix? That decides the fallback shape, not the mechanism. |
Uh oh!
There was an error while loading. Please reload this page.
Environment
Upgrade from DSH
0.2.1-rc.2to0.2.2-rc.2(Windows 11, Node 24.22.1) with long-lived sessions that had created many subagents before the upgrade.Observed
subagent/catalogrows withversion: 0: they carrylabelbut noname. In 0.2.2 every surface that addresses children by name (list_agents, the subagent panel,send_messagetargets, descendant paths) falls back to the raw session id for them. In our installation that was 175 children across 7 parent sessions.subagent/catalogevent for the samechildIdis not an option either: the V4 reader then rejects the whole session (duplicate catalog child …), and a duplicate siblingnameis rejected the same way. We confirmed both with DSH's own session verifier on copies.What we did locally
An offline, backed-up rewrite of each
version: 0row, in place at the sameseq, toversion: 3with anamederived from itslabel(grammar-valid, unique among siblings), verified with DSH's verifier before replacing each log. It works, but it is log surgery that ordinary users should not have to do.Suggestion
version: 0catalog row is read: derive a valid, sibling-uniquenamefromlabel(fallbackchild-N), orEither would let upgraded users address their existing children by name.
All reactions