Skip to content

Follow-ups from #607 review: quote verification, endpoint routing, SQL binding #609

Backlog

Description

@caohy1988

Follow-up from the review of #607 at 2c016d7. These didn't block approval.

  1. Quote verification can accept dossier headings. src/bigquery_agent_analytics/failure_judge.py:457 filters patterns in the quote, then line 460 searches the whole formatted dossier, so a substring of a heading or cut annotation ("Final response", "the last invocation", "chars shown") can produce agreed, accepted=True. Only the first match is checked, so a real quote that also appears earlier in the session title is rejected. Record the ranges of original field values when rendering and match only inside them.
  2. Endpoint classification by dot count (failure_judge.py:833) sends a full HTTPS endpoint URL down the ML.GENERATE_TEXT remote-model branch and drops the connection. A trailing dot with an empty model component passes validation.
  3. Connection and endpoint strings are interpolated into SQL (failure_judge.py:845-853) instead of being bound or validated as identifiers. The output schema handed to callbacks (line 648) is the same mutable object the SQL is built from, so a callback can change later queries.
  4. Default max_output_tokens=8192 (failure_judge.py:806, emitted at line 774) exceeds the 4,096 limit for partner and open models on the remote-model path that docs/failure_diagnosis.md:53 recommends.
  5. Custom error event names (session_dossier.py:432) go into the dossier without the one-line conversion and delimiter handling other fields get.
  6. The repair prompt (failure_judge.py:700) repeats reply-controlled text, e.g. the rejected category (line 516), in the instruction text after the previous-reply block.
  7. max_request_bytes (failure_judge.py:867) ignores key bytes and parameter overhead, and line 876 still sends a single prompt that exceeds it.
  8. A user task stored only in content_parts[].text renders as "(no task text recorded)" (session_dossier.py:361).
  9. A decoder RecursionError on one reply escapes the per-reply loop (failure_judge.py:692) and aborts the whole batch.
  10. Batch sizing re-encodes the chunk on every addition (line 872), quadratic in requests per chunk.
  11. The renderer keeps every full step body alive even when they're all omitted (session_dossier.py:200).
  12. Family detection returns None on an unknown alias before checking a known match (failure_diagnosis.py:251), and line 114 can infer a family from a project name.
  13. Span-target agreement compares only span_id (failure_diagnosis.py:224); equal ids in different traces report agreement.
  14. The combiner doesn't check that judge.label belongs to the same session as the result envelope (failure_diagnosis.py:185).
  15. An ambiguous label can omit its runner-up and rationale (failure_judge.py:510, :555) although the output schema requires them.

Activity

  1. added a commit that references this issue on Nov 30, 2026
  2. caohy1988 commented on Nov 30, 2026

    @caohy1988
    CollaboratorAuthor

    Follow-up from the review of #607 at 42bc2f6. These don't block approval. Items below are in addition to 11 and 15, which are still open as listed above.

    1. Byte cap vs the serialized request. failure_judge.py:1008 sizes raw SQL plus a fixed 8,192-byte allowance and :1027 adds 256 bytes per element, but the client merges its default job configuration at dispatch (:1082). In my runs a 10,628-byte request was skipped under a 16,384-byte cap, and a client with a default external-table schema sent 26,140 bytes under a 20,000 cap. Size the final serialized body (with the effective job config) against the cap before dispatch. The committed oversized-request test doesn't compare the transport body, so it doesn't catch this.
    2. Quotable ranges include inserted text. session_dossier.py:419 joins text parts after dropping non-text parts and :438 marks the whole joined string quotable. :542 does the same for a decoded final response, including the producer's truncation suffix (trace.py:92). Citing [TRUNCATED] alone, or a phrase spanning the two sides of an omitted image, gets agreed, accepted=True. Keep separators and cut annotations outside the quotable ranges.
    3. Task picked from the wrong turn. session_dossier.py:404 filters user messages by exact invocation ID and :405 falls back to the first message in the session. If the current user row has no invocation ID (or none do), the earlier question gets paired with the current answer. trace.py:414-418 already handles both cases for the response side.
    4. Smaller: failure_judge.py:839-850 accepts an incomplete resource path and allows arbitrary dots in a non-domain-scoped project (alpha.beta.gamma.delta becomes remote SQL, projects/analytics is accepted as an endpoint). The route and model ID are cached at :929/:952 while the settings stay mutable. Whitespace is collapsed before zero-width characters are removed for the dossier but in the opposite order for the quote (:449 vs :460), so "from \u200b ledger" is in the dossier yet verify_quote returns None. Item 10 has no committed guard for repeated encoding. A test at tests/test_failure_judge.py:786 uses a fixture with two calls in the last invocation, so that parameter never measured a rejection.

    Status of the earlier items at this head: 1 is mostly fixed (see item 2 above for what remains), 2–6 and 12–14 look fixed, 7 is partial (item 1 above), 8–10 are fixed apart from the missing guard for 10, 11 and 15 remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions