Repository navigation
feat(agents): snapshot, list snapshots and fork an agent - #61
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
rmanjunath18
force-pushed
the
feat/agent-fork
branch
from
October 29, 2026 12:14
87ce725 to
5cb4eb8
Compare
rmanjunath18
force-pushed
the
feat/agent-fork
branch
2 times, most recently
from
November 2, 2026 16:23
07f392b to
d4afa70
Compare
Agents and AsyncAgents gain create_snapshot, list_snapshots and fork, and the agent handles gain snapshot, snapshots and fork. Fork returns the new agent, Provisioning until ready. HTTP 425 now raises TooEarlyError. Adds docs, a changeset and an end-to-end example. Regenerates the aiagent types from the updated spec: snapshots now carry a required trigger and can be filesystem-only; audit events add program and network records, device and cloud.org, and new actor type captions. Keep trigger optional for older servers, accept snapshot_type on create, update test data to the new shapes, and stop the audit examples reading api on events that have none. AIPLATFORM-1564
rmanjunath18
force-pushed
the
feat/agent-fork
branch
from
November 2, 2026 17:03
d4afa70 to
5d6b647
Compare
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.
Python part of AIPLATFORM-1564.
What changes
client.agents.create_snapshot(id, params=None)andlist_snapshots(id, page=None, limit=None), plusagent.snapshot(..., wait_until_ready=False)andagent.snapshots()on the handles. Same params andSnapshotshape as the sandbox calls.client.agents.fork(id, name)andagent.fork(name)return the new agent, which is Provisioning untilwait_until_ready(). The source agent keeps running.TooEarlyErrorinstead of a plainAPIError. A 409 still raisesConflictError.rollbackalready existed and is unchanged.Spec regeneration (first commit)
The updated
specs/aiagent.yamlchanges some response shapes. After regenerating, 32 tests failed on old test data, and they now pass:triggeris now required. The SDK keeps it optional so older servers still work.snapshot_type(full/filesystem) can be set on create.api, so the audit examples check for it first.deviceandcloud.org.actor.user.typeis nowUser/API Key/System/Unknown, and the API key moved toprogrammatic_credentials. Theactor_typefilter still takesuser/api_key/system.Differs from the ticket
The ticket says fork returns a new sandbox. The API returns a new agent, and this PR follows the API.
Testing
uv run pytest: 692 passed. The newtests/test_agent_snapshots.pycovers each method, sync and async, plus the 409/425 errors.main(optional packages not installed).examples/agent_snapshot_fork_rollback.pywas run against the dev server: snapshot became Ready, fork had the agent's files, rollback restored them with the same ID and name, and cleanup succeeded.