Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
619cad4 to
f13c062
Compare
f13c062 to
0fa1165
Compare
|
Overall, I think this approach makes sense given the planned follow-up to stop copying event history. Through the investigation I did on this, Codex helped come up with a few areas where we can likely simplify and harden this PR:
|
|
@iplay88keys addressed the lineage and concurrency points:
We also already benchmarked the dense-history/deep-chain cases before this update:
PostgreSQL 18.6, 2-CPU/4-GiB container, warm cache, 30 measured executions after three warmups, generic prepared plans, 51 rows fetched for a 50-checkpoint page. Depth includes the current history. The fixture used synthetic 256-byte checkpoint payloads and checked expected IDs; these timings exclude API/protobuf overhead and do not measure cold storage, concurrent writes, or bloat. They predate this update's removal of the duplicate local scan. Separate index/pagination experiments improved dense cases, but those optimizations are not included here. Database/migration and relevant service tests passed with |
474ad09 to
af7db92
Compare
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Retain the runtime-revision lifecycle checks previously carried by a merge commit. Align fork documentation with main requiring terminal task boundaries for checkpoints. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
f44e031 to
5c703e0
Compare
| AND NOT EXISTS ( | ||
| SELECT 1 FROM agent_instance i WHERE i.pinned_checkpoint_id = agent_instance_checkpoint.id | ||
| ) | ||
| AND (agent_instance_checkpoint.state = 'DELETING' OR NOT EXISTS ( |
There was a problem hiding this comment.
dropped the pinned-live-instance guard here, tag gets deleted before the fk catches it?
| context_id UUID NOT NULL, | ||
| CONSTRAINT a2a_context_binding_key UNIQUE (id, context_id) | ||
| -- Each row owns one history branch; forks preserve the public A2A context_id. | ||
| CREATE TABLE agent_history ( |
There was a problem hiding this comment.
new migration instead of editing 000001 directly?
|
This pull request has been marked as stale because of no activity in the last 15 days. It will be closed in the next 5 days unless it is tagged "no stalebot" or other activity occurs. |
Forks omit inherited checkpoints because listing filters only by the instance that created them. A fork at C2 now lists C1 and C2 alongside its own checkpoints, excluding source-history boundaries after C2 and preserving each checkpoint's original provenance. Listing by a deleted instance's ID returns the same complete checkpoint lineage.
Store immutable parent-history and cutoff fields on
agent_history, renamed froma2a_contextto distinguish a history branch from its public A2A context ID. Retain a unique originating instance ID on history so listing can start there directly, without a local-checkpoint fallback. Composite foreign keys enforce instance/history identity and ownership and matching parent/child owner and context. The fork transaction validates that the cutoff identifies an event in the parent history with the expected task/snapshot boundary; failure rolls back the new history and instance. This avoids a circular history/event foreign-key dependency without adding a table. Schema changes remain in migration 1's pre-release baseline.Forks continue copying bounded events and rebuilding private task projections at terminal task boundaries. The instance's source-checkpoint reference retains fork-request identity and runtime provenance, including on deletion tombstones. Conversation reads remain local; checkpoint listing traverses retained history ancestry and bounds candidates per history before combining the checkpoint-ID page.
Retained histories protect inherited checkpoints and their snapshot Tags even after all related instances are deleted; there is currently no history garbage collection. Future event GC must preserve inherited boundaries and coordinate with fork creation. Fork creation and deletion checks share a history lock. Deletions already in progress can finish or retry. Deterministic PostgreSQL tests cover both operation orders, for both the fork's source checkpoint and an earlier checkpoint inherited by a later fork.
The protobuf contract documents that
Checkpoint.agent_instance_idremains the originating instance ID. The UI allows viewing and forking inherited checkpoints, while showing rename/delete only for checkpoints created in the current instance, in both the transcript and details modal. Mock listings now retain the inherited prefix and original provenance. The obsolete(source_instance_id, id)listing index is removed; the remaining source-instance lookups use the existing CREATING partial index.Validation:
af7db928, including checkpoint lineage after deletion and both runtime-retention scenarios (CI run). That head also passed the relevant service race tests. Live E2E for this UI/proto/index follow-up is pending CI.619cad47, before removing the duplicate local scan; they exclude API overhead. Query/index optimization experiments remain separate from this PR.