feat(bigquery-analytics): hot-path same-session pause_orphan resolution#7
feat(bigquery-analytics): hot-path same-session pause_orphan resolution#7caohy1988 wants to merge 1 commit into
Conversation
538ccce to
1903d36
Compare
|
Review finding: [P2] Treat fallback-emitted pauses as same-session matches. Please make the resolver count The rest of the split looks right: no hot-path sleep, no session-service/BigQuery read, no |
When a long-running tool resumes (a function_response in a user message),
resolve pause_orphan on the TOOL_COMPLETED row from the in-memory session
history only — a zero-I/O check that adds no latency to the resume path and
introduces no session-service or BigQuery read.
_resolve_same_session_pause_orphan returns:
* False — the originating paused call is present in this session's
in-memory history (definitely not an orphan);
* None — unknown / not yet settled: no id to pair on, no history, or
the pause was not found in the (possibly trimmed) in-memory history.
The emit path stamps attributes.adk.pause_orphan only when the resolver
returns a real bool; on None the key is omitted so consumers read it as
SQL NULL. The resolver never returns True: declaring a true orphan needs
the settled fallback (an off-hot-path session-service / BigQuery
reconciliation), deliberately out of scope here to keep the resume path
free of added reads. A persistent None is what that future fallback
upgrades to True.
Tests: resolver returns False only on a found pause, None for
not-found / empty / missing-id / no-session / id-without-matching-part,
never True, and does no session_service read; emit path stamps
pause_orphan=False when the pause is in history and omits it otherwise.
1903d36 to
8dc8621
Compare
|
P2 addressed in 8dc8621. The resolver now returns Test renamed Thanks for the cross-check against google#6140 — confirmed: that upstream PR is closed/stale at 04b374d; the live target is this fork PR #7, now at 8dc8621. |
|
Re-review: the P2 is fixed. The resolver now treats I re-checked the scope guardrails: no added hot-path sleep, no Only remaining gate is mechanical: the Python test matrix is still pending on the latest head |
Staging in the fork before targeting upstream google/adk-python.
Resolves
pause_orphanon the long-runningTOOL_COMPLETEDresume row from the in-memory session history only — zero I/O, no session-service or BigQuery read, no resume-path latency.falsewhen the originating pause is found in this session's in-memory history.true— the settled fallback (off-hot-path reconciliation) is a separate follow-up (adk-2.0 design: pause registry read-after-write strategy GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK#206).TestPauseOrphanSameSessioncovers found/not-found/missing-id/no-session/id-without-part/never-true/no-session-service-read, plus two emit-path assertions.Rebased on latest upstream main. Local test run blocked by an offline env (stale venv needs a newer opentelemetry-semconv; uv sync blocked by a platform-incompatible dep) — both files syntax-validated; relying on CI.