Skip to content

ADK: the sub-agent records rewrite bound is a setting - #344

Merged
shoom1 merged 1 commit into
developfrom
feature/adk-records-rewrite-setting
Nov 26, 2026
Merged

shoom1 merged 1 commit into
developfrom
feature/adk-records-rewrite-setting

Conversation

@shoom1

@shoom1 shoom1 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

A new setting, adk_subagent_records_rewrite_after, decides when ADK rewrites a conversation's sub-agent records session. Until now that bound was a fixed constant.

The setting

  • Default 100, at least 1, ADK only.
  • After this many appended writes, the next write copies the records whole into a fresh session and deletes the old one with its events.
  • An app sets it like any other setting: its settings class, the constructor, AGENTIC_ADK_SUBAGENT_RECORDS_REWRITE_AFTER, or the user settings file.
  • A project file cannot set it, and it is not offered in /settings.
  • The ADK manager reads it at each write, so a change applies at the next one.
  • adk/sessions.py::save_records takes it as rewrite_after=, defaulting to RECORDS_REWRITE_AFTER.
  • Nothing existing changes.

Tests: written first and seen failing.

  • The setting: its default, the constructor, the environment variable, that 0 is refused, and that a project file cannot set it.
  • A lower bound rewrites sooner (memory and sqlite).
  • A running ADK manager keeps the default, then rewrites at the next write after the setting changes.
  • Reviewed.

The full offline suite passes in the worktree (11131 passed), except TestChildImportOrigin::test_child_resolves_the_checkout, which fails the same way on develop under the worktree wrapper. On CI's library versions, the touched files, the contract suite and the settings placement tests pass.

adk_subagent_records_rewrite_after (100 by default, at least 1) is how many
writes a conversation's sub-agent records session takes before the next one
copies the records whole into the other session and deletes the old one with
its events. An app sets it like any other setting (its settings class, the
constructor, AGENTIC_ADK_SUBAGENT_RECORDS_REWRITE_AFTER, the user settings
file); a project file cannot. save_records takes it as rewrite_after=
(RECORDS_REWRITE_AFTER by default), and the ADK manager passes the setting at
each write, so a change applies at the next.
@shoom1
shoom1 merged commit fe57a88 into develop Nov 26, 2026
6 checks passed
@shoom1
shoom1 deleted the feature/adk-records-rewrite-setting branch November 26, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant