Repository navigation
feat(agentanalytics): add ToolResultClassifier hook and schema lifecycle callbacks - #2180
Conversation
3c304c1 to
d91de5a
Compare
|
Addressed in 8b1d2ad:
|
|
Updated the Behavior change section in the PR description per Review |
There was a problem hiding this comment.
Earlier review of a previous revision; the latest notes are in #2180 (review).
wojtas000
left a comment
There was a problem hiding this comment.
One doc change is needed before this merges: the Config doc says the three hooks reach the same verdicts as adk-python on the same inputs, and at this head they don't.
Must change before merge:
- config.go#L287-L289: adk-python records a ReflectAndRetry answer as a tool error before its classifier runs, and when the classifier abstains or fails it still records a result with a top-level
isErrororis_errorof true as a tool error (_callback_helpers.py). Here a retry-and-reflect answer goes to the classifier, so an OK or abstain verdict records TOOL_COMPLETED, and an abstain on{"isError": true}records TOOL_COMPLETED too. I know #2177 and #2178 add those rules. Until they land, let's name these differences in the sentence or drop the "same verdicts" claim, so someone porting a Python classifier doesn't expect retry answers to be recorded as errors by default.
Not blocking, but I'd like your view: OnSchemaReady runs on the view goroutine before it closes done (views.go#L751-L754), and Close waits on done with no bound (views.go#L799-L801) before it flushes the queue (bigquery_agent_analytics_plugin.go#L508-L511). The doc tells callers not to block, so this is the documented behavior. Still, a callback that blocks, for example an unbuffered send whose reader already gave up, keeps Close from returning and the queued rows are never flushed. I ran a test that holds the callback on a channel, and Close stayed blocked until I released it. adk-python's close() doesn't wait for the readiness pass, so the Go port could avoid tying Close to user code too.
|
Thanks for the careful read. The changes below are in Must change: the "same verdicts" sentence in the You're right. I checked it against
It also says what a port has to do: return The paragraph is now backed by tests, so it can't drift quietly: a real
I reproduced what you saw: with the callback held on a channel, Why So my view is that you're right:
The package's tests pass unchanged with either one, which also tells me nothing in the suite depends on I prefer 2. It changes a contract that this PR documents (" Inline threads
Verification at |
There was a problem hiding this comment.
Earlier review of a previous revision; the latest notes are in #2180 (review).
|
Thanks for catching these! Updated on the branch:
|
There was a problem hiding this comment.
Earlier review of a previous revision; the latest notes are in #2180 (review).
Every item in this review is fixed on the current head.
wojtas000
left a comment
There was a problem hiding this comment.
Approving. caohy1988's finish_task case is fixed: when an agent-level AfterToolCallback turns the validation failure into a completion, each AGENT_COMPLETED row now carries its own activation's span. My earlier item, the adk-python paragraph, is fixed too.
Two optional wording notes on config.go, neither blocks:
- The sentence about the classifier seeing every result holds for a tool that ran. For a missing tool or a non-function tool, retryandreflect answers and ADK skips the after-tool callbacks, so the classifier never sees that answer.
- "both kinds of result" could name the two it means.
On OnSchemaReady and Close, your option 2 in a follow-up PR is fine with me.
|
This conflicts with main in These PRs touch the same files, so could you rebase them as one stack, each on top of the one before: #2375, #2180, #2381, then #2380 and #2389? I'll merge each one as soon as it's up to date with main and green. |
d599621 to
64c0667
Compare
|
@wojtas000 Thanks! I rebased #2180 cleanly onto #2375 as Layer 2 of the linear stack ( |
There was a problem hiding this comment.
Earlier review of a previous revision; the latest notes are in #2180 (review).
64c0667 to
72817a9
Compare
|
Thanks for the thorough review. All findings have been addressed:
|
There was a problem hiding this comment.
Earlier review of a previous revision; the latest notes are in #2180 (review).
|
#2375 is merged, so could you rebase the rest of the stack onto main? Each branch still carries its two original commits, which landed on main as one squashed commit, so I went through caohy1988's latest items on all four PRs and none of them blocks merge for me, so once the stack is rebased and green I'll approve each one in turn. If you're touching the code anyway, three optional fixes from that pass:
|
…cle callbacks Add Config.ToolResultClassifier, a hook that decides whether a tool result returned without an error is recorded as TOOL_ERROR, with the classifier's message or adk-python's default message when that is empty, or as TOOL_COMPLETED. As in adk-python, it runs ahead of the built-in rule that records a result whose top-level isError or is_error is true as TOOL_ERROR: a ToolResultOK verdict overrides that rule, and a nil, abstaining, panicking or undefined verdict leaves the result to it. The classifier runs after the checks it cannot override (a tool error that OnToolErrorCallback recorded, an error that reached AfterToolCallback unrecovered), sees a confirmation outcome as the result ADK sends the model, and is skipped, with a warning that names only the tool, when it panics or returns a decision that is not defined. ToolResultVerdict has a blank first field, so code outside the package builds it with keyed literals only. Record every finish_task attempt on the calling activation before error returns and classification run, as one that ended the task, one that ended it with a tool result error, or one that did not end it and that a later AfterToolCallback can still turn into a completion. A finish_task response that does not end the task retires its own attempt, and one that ends the task ends the activation that holds an attempt for one of its ending calls, so a reused call ID cannot claim or retire another run's attempt. The verdict decides only the tool call's rows: a runtime-successful finish_task completion still completes the task span. Add Config.OnSchemaReady and Config.OnSchemaError: the first is called once the events table and, unless view creation is disabled, every startup view are ready; the second with the error when the table cannot be read, created or upgraded. Each is called at most once per plugin, and a panic in either is recovered and logged. A 409 or AlreadyExists response to a view DDL job counts as success only once the view is read back with the expected query. Part of google#2014
…tion, and view table checks Use the first finish_task response to decide task completion, attribute reused call IDs using leading EventActions map identity, O(N log N) causal supersession, event timestamps on failure retirement, multi-ID resolution before consumption, earliest-recorded tie-breaking, and unobservedTaskLocked fallback, and read platform.Now(ctx) before inv.mu only for task-mode agents. Reconcile evicted and restored traces under tm.mu at run end, retry 409 view metadata checks with status-only error logs and DeadlineExceeded unwrapping, validate ViewPrefix unconditionally, reject non-regular destination tables before OnSchemaReady, pre-format panic types as strings, and omit unregistered tool names from classifier warnings.
72817a9 to
621b546
Compare
|
@wojtas000 @caohy1988 Thanks for the reviews and the rebase pointer! I rebased the branch directly onto
Verified at |
caohy1988
left a comment
There was a problem hiding this comment.
The new merged-response matching still misattributes completions in a few concurrent cases, and a couple of the new error paths leak response bodies. I reproduced each of the issues below with a targeted test that fails at this head and passes at the merge base (6b4c6d5), so they look introduced by this change.
Merged-response attribution
trace_manager.go(~4632): a later attempt can supersede earlier candidates across different call IDs, and the set of observed IDs is built after that pruning. If worker A completessharedanduniquewhile its leading lookup is still in flight, worker B's later pending attempt forsharedcan wipe out A's evidence for both IDs. The runner then writes A'sAGENT_COMPLETEDon B's span and B'sAGENT_ERRORon A's. Keeping the full observed-ID set when deciding which activations could have produced the merged event, and only then applying timing/outcome preferences, should fix it.trace_manager.go(~5029): after the leading response's action maps have already identified the batch owner (~4974), the sibling search for leftover overruled call IDs still runs and can delete a different worker's recorded success with the same ID. Once the owner is known, retirement should be limited to that activation.trace_manager.go(~4924-4931, ~4982-4988): treatingmergedResponseas a blanket exemption from therecordedAtplausibility check, combined with the newest-first retirement scan, lets a delayed merged failure led by another tool retire a newer activation's attempts. A following completion with clearedEventActionsthen closes the older activation's span and leaves the real one open. I'd keep the timestamp check across different activations and only relax it once the event's activation is positively identified; when it can't be identified, leave the ambiguous newer attempts alone.
Trace restoration
trace_manager.go(~2923 / ~3317): when the two copies of the root are reconciled, the restored copy's nonempty trace ID wins, but it can still hold the generated ID from eviction even though the end row just adopted the ambient trace ID. Late rows then share the end row's root span ID with a different trace ID. The adopted ID should be preserved.
Error redaction
views.go(~1936): ordinary (non-409) view failures are now passed to the logger aserr.Error()strings, so a logger that strips bodies from error-typed arguments receives the service response body. Formatting these withsafeErrorStatusbefore logging, while keeping the typed cause on the returned error, would restore the previous behavior.schema_upgrade.go(~134): the new post-conflict metadata read wraps its error with%w, so the constructor error and theOnSchemaErrorcallback both include the upstream response body. Returning an error whoseError()reports the operation and status, withUnwrap()keeping the service error, avoids that.
Two smaller things worth addressing while you're in there: matching one merged batch is quadratic in the number of distinct call IDs while holding the invocation lock (roughly 32 ms at 2,048 IDs), and the eviction/restore test relies on a 5 ms sleep after a signal that fires before the original invocation lookup, so it can pass or fail depending on scheduling. Synchronizing after the lookup (e.g. in the agent metadata callback) would make it deterministic.
Full module tests, -race, vet, tidy and gofmt are all clean otherwise, and the classifier's zero-value behavior and at-most-once schema callbacks look good.
wojtas000
left a comment
There was a problem hiding this comment.
Approving. I re-checked the rebased commits against the earlier audit: the reused call_0 case now keeps both AGENT_COMPLETED rows with their own spans, the evicted-and-restored run is reconciled under tm.mu, and the eval views from #2175 came through the rebase unchanged. Build, vet, tidy and the race suite pass on the head and on its merge with main. Optional cleanup: popTaskAgentSpan, popTaskAgentSpanForCalls, finishedTaskLocked and the two retireFailedTaskAttempts helpers no longer have production callers.
…cle callbacks (google#2180) * feat(agentanalytics): add ToolResultClassifier hook and schema lifecycle callbacks Add Config.ToolResultClassifier, a hook that decides whether a tool result returned without an error is recorded as TOOL_ERROR, with the classifier's message or adk-python's default message when that is empty, or as TOOL_COMPLETED. As in adk-python, it runs ahead of the built-in rule that records a result whose top-level isError or is_error is true as TOOL_ERROR: a ToolResultOK verdict overrides that rule, and a nil, abstaining, panicking or undefined verdict leaves the result to it. The classifier runs after the checks it cannot override (a tool error that OnToolErrorCallback recorded, an error that reached AfterToolCallback unrecovered), sees a confirmation outcome as the result ADK sends the model, and is skipped, with a warning that names only the tool, when it panics or returns a decision that is not defined. ToolResultVerdict has a blank first field, so code outside the package builds it with keyed literals only. Record every finish_task attempt on the calling activation before error returns and classification run, as one that ended the task, one that ended it with a tool result error, or one that did not end it and that a later AfterToolCallback can still turn into a completion. A finish_task response that does not end the task retires its own attempt, and one that ends the task ends the activation that holds an attempt for one of its ending calls, so a reused call ID cannot claim or retire another run's attempt. The verdict decides only the tool call's rows: a runtime-successful finish_task completion still completes the task span. Add Config.OnSchemaReady and Config.OnSchemaError: the first is called once the events table and, unless view creation is disabled, every startup view are ready; the second with the error when the table cannot be read, created or upgraded. Each is called at most once per plugin, and a panic in either is recovered and logged. A 409 or AlreadyExists response to a view DDL job counts as success only once the view is read back with the expected query. Part of google#2014 * fix(agentanalytics): harden finish_task attribution, 409 DDL verification, and view table checks Use the first finish_task response to decide task completion, attribute reused call IDs using leading EventActions map identity, O(N log N) causal supersession, event timestamps on failure retirement, multi-ID resolution before consumption, earliest-recorded tie-breaking, and unobservedTaskLocked fallback, and read platform.Now(ctx) before inv.mu only for task-mode agents. Reconcile evicted and restored traces under tm.mu at run end, retry 409 view metadata checks with status-only error logs and DeadlineExceeded unwrapping, validate ViewPrefix unconditionally, reject non-regular destination tables before OnSchemaReady, pre-format panic types as strings, and omit unregistered tool names from classifier warnings. --------- Co-authored-by: Jan Wojtas <[email protected]>
Please ensure you have read the contribution guide before creating a pull request.
Linked issue
1. Link the issue this change is for. Required for everything except small
documentation and typo fixes. If no issue exists yet, please open one first.
2. Describe the change:
If applicable, please follow the issue templates to provide as much detail as
possible.
Problem:
A clear and concise description of what the problem is.
Relative to
main,plugin/agentanalyticslacked two configuration hooks present inadk-python's BigQuery Agent Analytics plugin:err == nil) tool results (beyond the built-in MCP top-level boolean"isError"/"is_error"rule), forcing domain failures to be logged asTOOL_COMPLETED(and emittingAGENT_RESPONSErows for tools inFinalResponseToolNames).OnSchemaReady/OnSchemaError) to observe when BigQuery destination table setup succeeds or fails and when startup view creation completes.In addition, edge cases in
ModeTaskfinish_taskspan attribution (reused tool-call IDs across overlapping, held, or concurrent fan-out activations; multi-partFunctionResponseevents under ADK's first-responseisFinishTaskSuccessFRrule; overruled sentinel responses behind empty-ID failures; delayed failure retirement; and parallel-tool merged event timestamps), evicted-and-restored invocation reconciliation at run end, and BigQuery schema/view verification (VIEW/MATERIALIZED_VIEW/EXTERNAL/SNAPSHOTdestination objects,409conflicts ontable.CreatewhenDisableSchemaUpgradeistrue, and409AlreadyExistsDDL conflicts before a view is ready) needed hardening.Solution:
A clear and concise description of what you want to happen and why you choose
this solution.
Config.ToolResultClassifier,ToolResultVerdict,ToolResultDecision):ToolResultClassifier func(ctx agent.Context, t tool.Tool, args, result map[string]any) ToolResultVerdictwith decisionsToolResultAbstain(zero value, deferring to the built-in"isError"/"is_error"check),ToolResultOK, andToolResultError.ctx,t,args, andresultdirectly fromAfterToolCallbackwithout cloning (callers must not mutateargsorresult, as documented onToolResultClassifierinconfig.go), redactsToolResultVerdict.ErrorMessageunlessDisableSensitiveKeyRedactionis true, and recovers panics or unknown decision values inrunToolResultClassifierby abstaining and logging only the pre-formatted panic type string (%sviafmt.Sprintf("%T", r), without passing the raw panic value as aLogger.Printfargument) or numeric decision (%d) viasafeLogf(which silently swallows anyLoggerpanic without logging tool names or payloads).Config.OnSchemaReady,Config.OnSchemaError):OnSchemaErrorsynchronously at most once when destination table metadata lookup, creation, type validation, or schema upgrade fails, pre-formatting any callback panic type viafmt.Sprintf("%T", r)before passing tosafeLogf.OnSchemaReadyat most once after table setup succeeds: synchronously when bothDisableCreateViewsistrueandCreateEvalViewsisfalse(without validating view definitions at startup), or after the background startup view pass creates every enabled view group (ViewDefinitionswhen!DisableCreateViews,EvalViewDefinitionswhenCreateEvalViews) without a validation failure in either enabled group. A failed startup view logs a warning (through a non-defaultConfig.Logger) and returns without invoking eitherOnSchemaReadyorOnSchemaError(only table setup failures invokeOnSchemaError;SyncViewsandSyncEvalViewsreturn view errors directly). Releases both callback closures once startup settles so captured state is not retained for the plugin's lifetime.validateDestinationTableTypeinensureTableAndSchemaandmaybeUpgradeSchema(including on412 PreconditionFailedschema-upgrade retries and after HTTP409/AlreadyExistsconflicts ontable.Createeven whenDisableSchemaUpgradeistrue), failing fast and routing toOnSchemaErroron disappearing (404) or non-TABLEobjects (VIEW,MATERIALIZED_VIEW,EXTERNAL,SNAPSHOT).409/AlreadyExistsview DDL conflicts inresolveDDLConflictby pollingtable.Metadatawith exponential backoff within the caller'sctxdeadline (falling back toviewDDLTimeoutwhenctxhas no deadline), retrying transient404,429,5xx, and staleViewQuerystates, returning immediately on non-VIEWobjects or non-retryable400/401/403errors, preservingcontext.DeadlineExceededalongside metadata errors inunverifiedViewConflictError.Unwrap(), formatting only structured status codes viasafeErrorStatus, and passing sanitizederr.Error()strings (%s) tologfinsyncAnalyticsViewsWithRetryHintwhile keeping%won the returned error.finish_taskattribution & trace reconciliation (classifyTaskResponses,resolveFinishedTaskLocked,retireFailedTaskAttemptsAtLocked,endInvocationTarget):isFinishTaskSuccessFRrule inclassifyTaskResponses, collecting all non-emptyendingCallIDs, trackingleadingActionCallIDandmergedResponse, and recordingoverruledEndingCallIDsbehind a failed first response.finish_taskcall'sEventActionsmaps (StateDelta/ArtifactDelta) innoteTaskStartandnoteTaskAttemptsoresolveFinishedTaskLockedandretireFailedTaskAttemptsAtLockedmatch the originating activation directly on single-part or leading-partFunctionResponseevents (even under frozen/equal clocks) without retaining user state payloads.endingCallIDsinresolveFinishedTaskLockedbefore consuming any attempt (consumeWinner), filters by timestamp plausibility (skipping per-attemptrecordedAtbounds on merged multi-tool responses so parallel tool timestamps do not exclude sibling attempts), applies anO(N log N)suffix-maximum causal supersession pass, requires a single activation to cover all surviving observed call IDs in a merged response (returningtaskMatchAmbiguouswithout consuming if disjoint activations conflict), and breaks same-tier single-call ties by earliest-recorded attempt (recordedAt, thenseq, then stack order) so concurrentcall_0fan-outs close every run cleanly.ev.Timestampand leading dispatch maps toretireFailedTaskAttemptsForEvent, falls back inunobservedTaskLockedtoctx's plausible activation or the newest plausible matching activation for both empty and non-empty unobserved call IDs, readsplatform.Now(ctx)inpushAgentSpanbefore acquiringinv.muand only whenchildren.taskModeis true, and reconciles evicted-and-restored invocations sharingrootSpanIDundertm.muinendInvocationTargetandcompleteRunEndTargetso restored traces close and unlink fromtm.invocationsandtm.evicted.Behavior change
What behaves differently for someone already on the current release?
Write "nothing" if that is the answer. Bug fixes count: a fix that alters an
observable result is still a behavior change.
Relative to
main:Config.ToolResultClassifier(ToolResultVerdict,ToolResultDecision): New opt-in hook; whennil(default), tool classification behaves as before. When set,runToolResultClassifierrecovers classifier panics or out-of-range decisions, logs only the pre-formatted panic type string (%s) or numeric decision (%d) viasafeLogf(which silently ignores panics fromConfig.Loggeritself and omits tool names and payloads), and falls back to the built-in"isError"/"is_error"rule.Config.OnSchemaReady&Config.OnSchemaError: New opt-in startup callbacks invoked at most once when enabled andbqClient != nil. Only destination table setup failures invokeOnSchemaError; a failed startup view logs a warning (through a non-defaultConfig.Logger) and returns without invoking eitherOnSchemaReadyorOnSchemaError(SyncViewsandSyncEvalViewsreturn view errors directly). When bothDisableCreateViewsistrueandCreateEvalViewsisfalse, view definitions are not validated at startup andOnSchemaReadyfires synchronously once table setup succeeds; when either view group is enabled,OnSchemaReadyfires only after every enabled view group validates and completes startup creation.ViewPrefixremains validated unconditionally during construction even whenDisableCreateViewsistrue.ensureTableAndSchema&validateDestinationTableType: PointingConfig.TableNameat an existing non-TABLEBigQuery object (VIEW,MATERIALIZED_VIEW,EXTERNAL, orSNAPSHOT), encountering a non-TABLEdestination on schema-upgrade retry, or hitting an HTTP409/AlreadyExistsconflict ontable.Createwhose follow-uptable.Metadataread fails (such as404) or returns a non-TABLEobject now fails plugin construction immediately (and triggersOnSchemaErrorif configured) even whenDisableSchemaUpgradeistrue, rather than succeeding at startup and failing later on BigQuery Storage WriteAppendRows.resolveDDLConflict&unverifiedViewConflictError: An HTTP409/AlreadyExistsresponse duringCREATE OR REPLACE VIEWis now treated as success only aftertable.Metadataconfirms aVIEWwith the expectedSELECTbody within the caller'sctxdeadline (retrying404,429,5xx, and stale view queries, and failing fast on non-VIEWobjects or400/401/403). Unverified conflicts returnunverifiedViewConflictError, whoseError()and startup warning (err.Error()via%s) expose only structured HTTP/gRPC status codes viasafeErrorStatuswithout echoing raw server response bodies or passing raw error structs toLogger.Printf, whileUnwrap()preserves the underlying conflict, metadata error, andcontext.DeadlineExceeded.classifyTaskResponses,finish_taskspan attribution, and trace-end reconciliation:finish_taskFunctionResponseevents follow ADK's first-response rule (classifyTaskResponses): a non-ending firstfinish_taskpart keeps the task open (retiringfailedCallsandoverruledEndingCallIDs) rather than ending the span on a trailing sentinel part.finish_taskcompletions now resolve across allendingCallIDsbefore consuming any attempt, using leading-partEventActionsmap identity, event-timestamp plausibility,O(N log N)causal supersession, tier precedence, and earliest-recorded tie-breaking. Unlikemain, if a single merged event carries surviving observedfinish_taskcall IDs split across disjoint activations (without dispatch-map disproof),resolveFinishedTaskLockedreturns ambiguous and leaves spans open rather than guessing across conflicting call IDs.finish_taskresponses (retireFailedTaskAttemptsAtLocked) preserve sibling activations' recorded terminal outcomes when retiringfailedCalls, exclude activations and single-call attempts recorded afterev.Timestamp, and retireoverruledEndingCallIDsbehind empty-ID first failures.pushAgentSpanskips calling customplatform.TimeProvideron non-task agents (!children.taskMode), andendInvocationTarget/completeRunEndTargetclose and unlink evicted-and-restored invocations sharing the samerootSpanID.Testing Plan
Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.
Unit Tests:
With your source change reverted and your tests kept, which test fails?
Name it. If nothing fails, the tests do not yet cover the change. This is the
cheapest moment to find that out.
Please include a summary of passed go test results.
ToolResultClassifier/runToolResultClassifier:TestToolResultDecision_String,TestPlugin_ToolResultClassifier_Verdicts,TestPlugin_ToolResultClassifier_ErrorMessageRedaction,TestPlugin_ToolResultClassifier_EventFilters,TestPlugin_ToolResultClassifier_FailuresAreSkipped,TestPlugin_ToolResultClassifier_Precedence,TestPlugin_ToolResultClassifier_Runner, andTestDocParity_ToolResultClassifierBuiltInRules.OnSchemaReady/OnSchemaError,ensureTableAndSchema,validateDestinationTableType, orresolveDDLConflict:TestNotifySchemaCallbacks,TestPlugin_OnSchemaError,TestPlugin_OnSchemaReady_TablePass,TestPlugin_OnSchemaReady_ViewPass,TestPlugin_SchemaCallbacks_ConcurrentPlugins,TestPlugin_SchemaCallbacks_ClosuresReleased,TestDocParity_SchemaCallbacksAtMostOnce,TestEnsureTableAndSchema_ConflictOnCreateRecovery,TestValidateDestinationTableType,TestMaybeUpgradeSchema_RetryRevalidatesDestinationTableType,TestIsRetryableConflictVerifyError, andTestResolveDDLConflict_EdgeCases.classifyTaskResponses,resolveFinishedTaskLocked,retireFailedTaskAttemptsAtLocked,noteTaskStart,pushAgentSpantask-mode clock gating, orendInvocationTargettrace reconciliation:TestClassifyTaskResponses_MultiPartOrderings,TestPlugin_FinishTask_OverlappingErrorDoesNotStealCompletion,TestPlugin_FinishTask_PromotedErrorClosesOriginatingSpan,TestPlugin_FinishTask_MixedResponseEventEndsOwnActivation,TestPlugin_FinishTask_FailedFirstThenCompletedInSameEventStaysOpen,TestPlugin_FinishTask_FailedEmptyIDThenCompletedStaysOpenAndRetiresOverruledCall,TestPlugin_FinishTask_ReusedCallID_AttributionOrderings,TestPlugin_FinishTask_PromotedRun2DeliveredBeforeHeldRun1Completion,TestPlugin_FinishTask_TrailingObservedEndingCallIDResolvesActivation,TestPlugin_FinishTask_ConcurrentCall0ReuseFanOut,TestPlugin_FinishTask_MergedReusedLeadingShortCircuitedAndUniqueTrailingCallID,TestPlugin_FinishTask_CoordinatorBufferedFailureDoesNotRetireNewerWorkerAttempt,TestPlugin_FinishTask_MergedParallelToolTimestampPredatingAfterToolRecordedAt,TestPlugin_FinishTask_NoteTaskStartAndOverruledEndingGuards,TestTraceManager_FinishedTaskLocked,TestRetireFailedTaskAttemptsLocked_PreservesSiblingRecordedSuccess,TestEndInvocation_ReconcilesEvictedAndRestoredActiveTrace,TestPushAgentSpan_PlatformClockOutsideLockAndTaskModeOnly, andTestResolveFinishedTaskLocked_512OverlappingActivationsEquivalence.Verification summary at
621b5462(rebased directly onorigin/main6b4c6d55) forplugin/agentanalytics:gofmt -l plugin/agentanalytics,git diff --check, andGOWORK=off go -C plugin/agentanalytics mod tidy -diff: cleango -C plugin/agentanalytics vet ./...andgolangci-lint run --max-same-issues=0 --max-issues-per-linter=0 ./...(inplugin/agentanalytics): PASS (0issues)-race -mod=readonly -count=1across classifier, schema-callback,resolveDDLConflict,ensureTableAndSchema,finish_task, trace reconciliation, eval-view,doc.go, andafterRunsuites: PASS (23.939s)go -C plugin/agentanalytics test -mod=readonly -count=1 ./...: PASS (145.159s)Manual End-to-End (E2E) Tests:
Please provide instructions on how to manually test your changes, including any
necessary setup or configuration. Please provide logs or screenshots to help
reviewers better understand the fix.
Not manually run against a live BigQuery dataset in this environment; covered by unit tests and mock HTTP/gRPC BigQuery and BigQuery Storage Write transports in
plugin/agentanalytics. To verify manually against live BigQuery, configureBigQueryAgentAnalyticsPluginwithProjectID,DatasetID,TableName,ToolResultClassifier,OnSchemaReady, andOnSchemaError, run anllmagenttool call returning a domain error map, and inspect the resultingTOOL_ERRORrow andv_tool_errorview in BigQuery.Checklist
Additional context
Add any other context or screenshots about the feature request here.
Aligns
plugin/agentanalyticswithadk-python'stool_result_classifierand schema readiness/error callback surface while documenting Go-specific contract details inconfig.goanddoc.go.