FirestoreSessionService ignores `app:` / `user:` state prefixes, so app and user state are never shared across sessions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with appendEvent in contrib/firestore-session-service's FirestoreSessionService.java (prefix split around L657-L689, removal check at L666), then getSession (around L262-L272), and compare with InMemorySessionService.java appendEvent (L316-L338) and mergeWithGlobalState (L398). Run the module's existing mocked tests to see how app-state and user-state writes are asserted. Done means app: and user: keys are shared across sessions and merged on read, temp: keys are not persisted, and State.REMOVED deletes the key.
索引モデルが issue の本文から書いたものです。
説明
🔴 Required Information
Describe the Bug:
FirestoreSessionService does not implement ADK's scoped state. ADK's State class defines app:, user: and temp: prefixes (State.APP_PREFIX, USER_PREFIX, TEMP_PREFIX), and InMemorySessionService stores app:/user: keys in shared app/user stores and merges them back into every session. FirestoreSessionService behaves differently:
appendEventonly routes keys starting with_app_/_user_to theapp-state/user-statecollections. Keys written through the normal ADK API (app:theme,user:name) fall through to the per-sessionstatefield, so they are only visible in that one session.- The
app-stateanduser-statecollections are write-only.getSession,createSessionandlistSessionsnever read them, so even a value stored under_app_/_user_never reaches another session. temp:keys are persisted in the session document.BaseSessionService.appendEventskips them.- Removal checks
value == null, but ADK marks removals with theState.REMOVEDsentinel, so a removed key is kept and the sentinel object is written to the session'sstatemap instead of the key being deleted.
Code references (main @ 189d463):
contrib/firestore-session-service/.../FirestoreSessionService.javaappendEvent(prefix split around L657-L689, removal check L666)getSessionbuilds the session only from the session document'sstatefield (around L262-L272)- Compare
core/.../InMemorySessionService.javaappendEvent(L316-L338) andmergeWithGlobalState(L398)
Steps to Reproduce:
- Configure a runner with
FirestoreSessionService. - In session A, a tool or callback sets
context.state().put("user:name", "Jae"). - Create session B for the same app and user, and read
user:name.
The same can be shown with the module's existing mocked tests (no Firestore needed): appending an event with state delta {"app:theme": "dark", "user:name": "Jae"} never calls set on the app-state / user-state documents, and the session document is updated with state = {app:theme=dark, user:name=Jae}. Appending {"temp:scratch": "x", "gone": State.REMOVED} writes both temp:scratch and the REMOVED sentinel into the session's state.
Expected Behavior:
Same semantics as InMemorySessionService (and the Python ADK database session services): app: keys shared by all sessions of the app, user: keys shared by all sessions of the app and user, merged back into Session.state() on getSession / createSession / listSessions, temp: keys not persisted, and State.REMOVED deleting the key.
Observed Behavior:
In session B, user:name is missing. App/user state behaves like session state. temp: values persist, and removed keys are not deleted.
Environment Details:
- ADK Library Version: main @ 189d463 (1.11.1-SNAPSHOT),
google-adk-firestore-session-service - OS: Linux
- TS Version: N/A
Model Information:
- N/A (session service bug, model independent)
🟡 Optional Information
Regression: No. The _app_ / _user_ handling has been there since the Firestore service was added.
Additional Context:
A fix would (a) split on State.APP_PREFIX / State.USER_PREFIX, (b) merge the app-state / user-state documents back into the session state with the prefixes on read, (c) skip State.TEMP_PREFIX, and (d) treat State.REMOVED as a delete (FieldValue.delete() in the shared stores). Existing data stored under _app_ / _user_ keys (if anyone relied on that convention) may need a note in the changelog. I'm happy to send a PR if this direction looks right.
- 主要言語
- Java
- スター
- 1.7k
- フォーク
- 433
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 42
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-java のほかの issue
-
GeminiUtil placeholder user turn ("Continue output. DO NOT look at this line ...") is flagged by prompt injection filters対応中かも @hemasekhar-p が 3 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google/adk-java#1628 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[spring-ai] ToolConverter silently drops enum and items from tool parameter schemas対応中かも @hirematha が 6 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google/adk-java#1609 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[spring-ai] Streaming responses ending with CJK punctuation (。!?) are misclassified as partial and never persisted to the session対応中かも @hirematha が 6 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
google/adk-java#1608 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
FirestoreSessionService compares event timestamps as text, reordering or skipping same-second eventsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
FirestoreSessionService loses event fields on reload, breaking later turns and tool confirmations対応中かも @innoprej が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
google/adk-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
utopia-rise/godot-jvm#1004 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
spring-projects/spring-grpc#442 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
resilience4j/resilience4j#2547 ·
メンテナーはふだん 9 日以内に返信
-
Clock.MakeDate continues execution and returns a rolled-over instant after dispatching error on invalid date対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
mit-cml/appinventor-sources#4155 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
Hira-shi/PW1-DAI-Carrel-Egal-Eyer#28 ·
メンテナーはふだん 1 日以内に返信