Repository navigation
Conversation
…e-ai#4140) - CompositeFilesystem 新增可选 journalStorageBackend 构造参数: Native Session Log 属于路由表之外的能力面,无法用合成查询路径选择 - RemoteFilesystemSpec 装配时保留 sessions overlay 引用并显式传入: 'agents/' 永远 prefix-match 不到 'agents/{agentId}/sessions/' 路由, 旧实现静默把 journal 落到本地默认后端,远程 store 始终为空 - 保留无参构造的旧回退行为(非 spec 装配的 composite 不受影响) - 回归:复合面写入必须落在 store 的 sessions 命名空间并可读回
|
Withdrawing in favor of #4146 — @iluv7 submitted the same approach three days before I started (#4146 opened 11-12; I claimed the issue on 11-15 and missed it because my timeline check relied on the events API, which did not surface the cross-reference). Design note: my independent implementation converged on the identical shape (optional explicit backend + spec passes the sessions overlay + two-arg constructor preserved), which I've posted as a review on #4146 — plus one actionable point there: #4154 renamed My branch is deleted; the regression idea I had (CAS write through the composite must land in the store's sessions namespace) is covered by the broader |
Summary
CompositeFilesystem.journalStorage()selected its backend with a synthetic single-segment query —routeForPath("agents/")— which can never prefix-match the spec's registered session routeagents/{agentId}/sessions/(prefix matching requires the query path to start with the route prefix). Every Native Session Log silently landed on the default local backend: no exception, no WARN,agentscope_storestays empty, and pod recycling loses session history in multi-replica deployments.Same "prefix-hierarchy mismatch" family as #2918 / #2693, but a call site PR #3386 did not touch.
Fix
Session journals are a capability outside the route table's path space — they cannot be selected with a synthetic query path at all. The party that assembles the route table knows the sessions backend, so it names it explicitly:
CompositeFilesystemgains an optionaljournalStorageBackendconstructor parameter;journalStorage()delegates to it when set, keeping the legacy fallback for composites assembled without one (non-spec composites —RoutedSandboxFilesystem, builder routes — behave exactly as before).RemoteFilesystemSpec.toFilesystemkeeps a reference to the sessions overlay it already builds and passes it to the composite.OverlayFilesystem.journalStoragedelegates to its upperRemoteFilesystem, so the storage isStoreJournalStorage(store, <user-namespace> + sessions segment)— the backend the reporter verified as correct when bypassing the composite.Regression
journalStorageDelegatesToTheSessionsRouteBackend: a CAS write through the spec-composed composite must land in the store under the sessions namespace (agents/{agentId}/users/{uid}/sessions/__agentscope_session_log_v1__) and round-trip through a read on the same storage — the exact discriminator from the reporter's reproduction.Full harness module suite green on the merged batch state (1833/1833).