agent2: Initial infra for checkpoints and message editing (#36120)

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Ben Brandt 2025-08-13 17:46:28 +02:00 committed by GitHub
parent f4b0332f78
commit 23cd5b59b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1374 additions and 582 deletions

View file

@ -12,7 +12,7 @@ workspace = true
path = "src/git.rs"
[features]
test-support = []
test-support = ["rand"]
[dependencies]
anyhow.workspace = true
@ -26,6 +26,7 @@ http_client.workspace = true
log.workspace = true
parking_lot.workspace = true
regex.workspace = true
rand = { workspace = true, optional = true }
rope.workspace = true
schemars.workspace = true
serde.workspace = true
@ -47,3 +48,4 @@ text = { workspace = true, features = ["test-support"] }
unindent.workspace = true
gpui = { workspace = true, features = ["test-support"] }
tempfile.workspace = true
rand.workspace = true

View file

@ -119,6 +119,13 @@ impl Oid {
Ok(Self(oid))
}
#[cfg(any(test, feature = "test-support"))]
pub fn random(rng: &mut impl rand::Rng) -> Self {
let mut bytes = [0; 20];
rng.fill(&mut bytes);
Self::from_bytes(&bytes).unwrap()
}
pub fn as_bytes(&self) -> &[u8] {
self.0.as_bytes()
}