Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## alpha/10 #1506 +/- ##
============================================
+ Coverage 82.26% 82.78% +0.51%
============================================
Files 216 218 +2
Lines 36662 36743 +81
============================================
+ Hits 30160 30416 +256
+ Misses 4362 4227 -135
+ Partials 2140 2100 -40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Follow rollback targets during bounded replay and let callers guard the source with FromEventID. Report checkpoint cleanup failures after a successful rollback and support retrying the deletion by rollback event ID. Record the idle event in session checkpoints, preserve pending inputs across failed resumes, and batch turn start with its input. Document the event model and migration in English and Chinese.
|
问题简述: 为什么将新写入的 导致问题的链路: 如果业务需要支持 修复建议: 如果没有必须禁止空列表的约束,能否继续允许显式的空列表替换?如果这个限制是有意的设计,请说明 |
|
问题简述: 为什么将历史重放和回滚查找从没有页数上限,改为默认最多扫描 300 页?新增上限要解决什么具体问题,300 页的取值依据是什么? 导致问题的链路: 对于正常分页的长会话,如果 300 页内还没有找到生效的 修复建议: 能否说明长会话超过上限时的推荐处理方式,并考虑提供显式不限制页数的选项?目前非正值仍使用默认 300 页,只能调大上限。如果主要是防止异常分页,重复游标和空页检查之外,硬性页数上限还要覆盖哪种场景? |
What type of PR is this?
ADK session feature and correctness fixes for
alpha/10.Session behavior
session.status_runningand the input messages in one orderedAppendEventscall. Atomicity depends on the store. The runner releases the session handle on setup and execution panics.RollbackSessionaccepts any earlieridle(end_turn)in the same session, including a turn skipped by a previous rollback. Rollback appends a marker with the effectiveFromEventIDand requestedToEventID. SetWithRollbackSessionFromEventIDto reject the request withErrSessionHeadChangedif the user’s starting point has changed.Runfollows rollback targets backward to the applicablemessages_replacedor the start of the log, then replays messages in order. Message updates retain the target message ID. Both replay and rollback default to 300 pages and detect stalled pagination. Configure them independently withSessionConfig.MaxReplayLoadPagesandWithRollbackSessionMaxLoadPages.Resumecompares it with the latest checkpoint-relevant event and returnsErrCheckpointStaleif the session has advanced. It decodes execution state before appendingx.resume.request_started. TurnLoop uses the checkpoint consumption result to preserve retryable state and queued inputs.errors.Asexposes a*RollbackCheckpointCleanupError. Pass itsRollbackEventIDtoRetryRollbackCheckpointCleanupto retry only deletion. A newer execution or rollback protects its checkpoint, even when two rollbacks chose the same idle.The event log guides walk through replay, reduction clear, resume, rollback and timeline pagination. English · 中文
Alpha compatibility
RollbackSessionOptions.ExpectedHeadEventIDtoFromEventIDandWithRollbackSessionExpectedHeadEventIDtoWithRollbackSessionFromEventID. The stored rollback source changed fromSessionRollbackEvent.PreviousHeadCommitEventIDtoFromEventID. In a customSessionEventStore.LoadEvents, readrollback.from_event_idwhen present and fall back torollback.previous_head_commit_event_idfor older JSON records. For gob or other field-name formats, decode the legacy field in the storage representation and map it toFromEventID.IdleEventIDstill validate session ownership whenSessionIDis present. Newmessages_replacedwrites require at least one message. Previously stored explicit empty lists still replay as a cleared context.ModelSpanMeta.Usagenow uses*schema.TokenUsage, andTTFTMSmoves fromSpanEventtoModelSpanMeta. This removesSpanEvent.Name,ModelSpanMeta.AcceptedandModelUsage. The event classification, normalization and emitted-kind validation helpers are now package-private.Validation
GOWORK=off go test -race -count=1 ./...passed on Go 1.27.1. Focused rollback, cleanup, checkpoint resume and pagination regressions also passed on Go 1.18.10.alpha/10reported zero issues in./internal/schema/...and./adk/....BenchmarkSessionEventClonemeasured 9 allocations perschema.Messagesnapshot and 7 perschema.AgenticMessagesnapshot. The encode/decode/validate path usingschema.HumanReadableSerializermeasured 369 and 351 allocations respectively.