Add .tar.bz2 archive support for ACP agent server downloads (#52188)

## Summary

- Added `TarBz2` variant to `AssetKind` enum for `.tar.bz2` / `.tbz2`
archives
- Implemented `extract_tar_bz2` using the `bzip2` feature of
`async-compression` (already a workspace dependency, just enabled the
feature flag)
- Wired up both streaming and file-based extraction paths in
`github_download.rs`
- Added `.tar.bz2` / `.tbz2` URL detection in both
`LocalExtensionArchiveAgent` and `LocalRegistryArchiveAgent`

This unblocks ACP registry entries (like Goose) that only ship
`.tar.bz2` archives.

Reference: https://github.com/block/goose/issues/8047

## Test plan

- [ ] Verify `cargo check` and `clippy` pass (confirmed locally)
- [ ] Test downloading an ACP agent that ships a `.tar.bz2` archive
(e.g., Goose)
- [ ] Verify existing `.tar.gz` and `.zip` agent downloads still work

Release Notes:

- Added support for `.tar.bz2` archives in ACP agent server downloads,
unblocking registry entries like Goose that only ship bzip2-compressed
tarballs.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Vincenzo PalazzoandBen Brandt authored and GitHub committed 2026-03-25 07:54:23 +00:00
1 parent 3db352e7d3
commit fe0b77b3a9
8 files changed
+52 -12

No files matched your search

+4 -4
View File
@@ -448,7 +448,7 @@ impl LspInstaller for TyLspAdapter {
async_fs::create_dir_all(&destination_path).await?;
let server_path = match Self::GITHUB_ASSET_KIND {
AssetKind::TarGz | AssetKind::Gz => destination_path
AssetKind::TarGz | AssetKind::TarBz2 | AssetKind::Gz => destination_path
.join(Self::build_asset_name()?.0)
.join("ty"),
AssetKind::Zip => destination_path.clone().join("ty.exe"),
@@ -538,7 +538,7 @@ impl LspInstaller for TyLspAdapter {
let path = last.context("no cached binary")?;
let path = match TyLspAdapter::GITHUB_ASSET_KIND {
AssetKind::TarGz | AssetKind::Gz => {
AssetKind::TarGz | AssetKind::TarBz2 | AssetKind::Gz => {
path.join(Self::build_asset_name()?.0).join("ty")
}
AssetKind::Zip => path.join("ty.exe"),
@@ -2520,7 +2520,7 @@ impl LspInstaller for RuffLspAdapter {
} = latest_version;
let destination_path = container_dir.join(format!("ruff-{name}"));
let server_path = match Self::GITHUB_ASSET_KIND {
AssetKind::TarGz | AssetKind::Gz => destination_path
AssetKind::TarGz | AssetKind::TarBz2 | AssetKind::Gz => destination_path
.join(Self::build_asset_name()?.0)
.join("ruff"),
AssetKind::Zip => destination_path.clone().join("ruff.exe"),
@@ -2610,7 +2610,7 @@ impl LspInstaller for RuffLspAdapter {
let path = last.context("no cached binary")?;
let path = match Self::GITHUB_ASSET_KIND {
AssetKind::TarGz | AssetKind::Gz => {
AssetKind::TarGz | AssetKind::TarBz2 | AssetKind::Gz => {
path.join(Self::build_asset_name()?.0).join("ruff")
}
AssetKind::Zip => path.join("ruff.exe"),