Add Kotlin to the session rewind page - #2164
Open
happyhuman wants to merge 2 commits into
Open
Conversation
The page was single-language: one bare Python fence, no tab structure, and a badge div listing Python only. Kotlin has had Runner.rewindAsync with matching semantics, so the code block is converted into a Python/Kotlin tab group with the Python content kept verbatim. Semantics were checked against the implementation rather than inferred from the method name, since the page makes specific promises. Two hold: AbstractRunner.rewindAsync appends a synthetic user event carrying reversing state and artifact deltas, so rewound requests stay in the log as the "How it works" section describes; and keys prefixed app: or user: are skipped when the delta is computed, which is exactly the "Global agent resources" limitation. Worth knowing for anyone reading the interface: Runner.rewindAsync has a default implementation that throws NotImplementedError. AbstractRunner overrides it and InMemoryRunner extends AbstractRunner, so the documented path works, but a custom Runner built straight on the interface would not. Runner.close was on the same backlog row and is left out: it is a lifecycle concern with nothing to do with rewinding.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The badge said Kotlin v0.8.0, the version adk-docs compiles against, rather than the introducing release. Checking the tags, rewindAsync is absent at v0.1.0 and v0.2.0 and first appears in AbstractRunner at v0.3.0 - so the backlog row that recorded it as a v0.1.0 member was wrong as well.
Collaborator
Author
|
Update: the badge originally read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/sessions/session/rewind.mdwas single-language: one bare Python fenced block, no tab structure, badge div listing Python only. This converts the block into a Python/Kotlin tab group (Python content kept verbatim, only re-indented into the tab), adds the Kotlin badge, and adds a compiledexamples/kotlin/snippets/sessions/RewindExample.kt.Semantics were verified, not assumed
The backlog row asked for this explicitly, and the page makes specific promises. Both check out against the v0.8.0 implementation:
AbstractRunner.rewindAsyncappends a synthetic user-authored event carrying reversingstateDelta/artifactDelta— nothing is deletedcomputeStateDeltaForRewindskips keys prefixedapp:/user:The KDoc also states it mirrors Python's
runners.py:rewind_async.Runner.rewindAsyncis an interface method whose default implementation throwsNotImplementedError— "override to support session rewind".AbstractRunnerdoes override it andInMemoryRunnerextendsAbstractRunner, so the documented path genuinely works. But anyone implementingRunnerdirectly gets the throwing default. I did not put this in the page, since the page only ever discussesInMemoryRunner; say the word if you'd like it called out.Also in the row, deliberately excluded
Runner.closewas listed alongsiderewindAsync. It is a lifecycle concern unrelated to rewinding, so it does not belong on this page.Verification
Grounded against the
v0.8.0git tag. Full ladder green (L0, L1 compile with KSP, L2 ktlint, L3, L5, L6). L4runSnippetsSKIP — no such Gradle task in this repo.Tracked as KT-33.