paperclip/packages/adapter-utils/src
Nicky Leach d5208d30c1
feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072)
## Thinking Path

> - Paperclip runs AI agents through adapter execution services.
> - The adapter runtime records spans for each stage of agent startup.
> - The managed runtime packs workspace tarballs before it uploads them.
> - These pack operations had no host span, so `stage.sync` omitted pack
time.
> - This pull request adds one `pack` span around both tarball builds.
> - The span nests under the active `stage.sync` step and improves trace
detail.

## Linked Issues or Issue Description

**What existing behavior does this improve?**

The managed runtime workspace sync builds a git-history tarball and a
workspace-overlay tarball before upload.

**Subsystem affected**

The change affects `packages/adapter-utils`, which provides adapter
execution and managed runtime support.

**Current behavior**

The host builds both tarballs without an OpenTelemetry span. The
`stage.sync` trace therefore omits the host pack duration.

**Proposed behavior**

The host wraps both tarball builds in one `pack` span. The executor
parents this span under the active startup step.

**Reason and benefit**

The trace shows the time that the host spends packing workspace data.
Operators can use the existing runtime span tree to find sync delays.

**Breaking changes**

None. The default span runner remains a no-op runner, and the existing
control flow remains unchanged.

## What Changed

- Add an optional `runtimeSpan` runner to the managed runtime
preparation path.
- Create one host `pack` span around the two workspace tarball builds.
- Parent the `pack` span under the active startup step.
- Add unit coverage for span emission and span nesting.

## Verification

- Run `tsc --noEmit` for `@paperclipai/adapter-utils`.
- Run the `@paperclipai/adapter-utils` Vitest suite.
- Confirm the suite reports 448 passed tests and 4 skipped tests.
- Confirm the trace test records `pack` under `stage.sync`.

## Risks

The change adds optional tracing only. The default no-op runner
preserves behavior when tracing is not configured.

## Model Used

OpenAI Codex, GPT-5, tool use and code execution. The model reviewed the
handoff and opened this pull request. The implementation author supplied
the commit.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` /
`Closes: #` / `Refs: #` OR (b) described the issue in-PR following the
relevant issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-08-07 17:47:30 -07:00
..
acpx-engine feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072) 2026-08-07 17:47:30 -07:00
test-support feat(mcp) [split 4/8]: wire gateway runtime and Smoke Lab (#9559) 2026-07-14 15:07:30 -05:00
billing.test.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
billing.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
command-managed-runtime.test.ts feat(sandbox): stage referenced projects into the run sandbox (#10469) 2026-07-29 16:09:57 -07:00
command-managed-runtime.ts feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072) 2026-08-07 17:47:30 -07:00
command-redaction.ts [codex] Roll up May 17 branch changes (#6210) 2026-05-17 17:15:06 -05:00
env-bindings.test.ts fix(adapters): keep user-scoped env bindings on the agent Test action (#10926) 2026-08-05 17:18:41 -07:00
env-bindings.ts fix(adapters): keep user-scoped env bindings on the agent Test action (#10926) 2026-08-05 17:18:41 -07:00
exclude-patterns.ts Fix sandbox git publishing and large workspace uploads (#8422) 2026-06-20 22:03:55 -07:00
execution-target-sandbox.test.ts feat(acp): stream Daytona sandbox agent output and remove the host output poll (#11049) 2026-08-07 14:29:58 -07:00
execution-target.test.ts Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
execution-target.ts feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072) 2026-08-07 17:47:30 -07:00
git-workspace-sync.test.ts fix(adapter-utils): carry the workspace origin remote into transported git workspaces (#10873) 2026-08-05 10:24:01 -07:00
git-workspace-sync.ts fix(adapter-utils): carry the workspace origin remote into transported git workspaces (#10873) 2026-08-05 10:24:01 -07:00
index.ts fix(adapters): keep user-scoped env bindings on the agent Test action (#10926) 2026-08-05 17:18:41 -07:00
local-process-sandbox.test.ts fix(adapter-utils): keep sandbox proxy sockets within Linux path limit (#10221) 2026-07-26 10:52:16 -05:00
local-process-sandbox.ts fix(adapter-utils): keep sandbox proxy sockets within Linux path limit (#10221) 2026-07-26 10:52:16 -05:00
log-redaction.ts fix(ui): external adapter selection, config field placement, and transcript parser freshness 2026-04-03 21:11:22 +01:00
mcp-isolation.integration.test.ts feat(skills): import skills from projects (#9620) 2026-07-15 18:01:44 -05:00
remote-execution-env.ts Sanitize remote execution envs at the boundary (#5325) 2026-05-05 19:30:14 -07:00
remote-managed-runtime.test.ts feat(sandbox): stage referenced projects into the run sandbox (#10469) 2026-07-29 16:09:57 -07:00
remote-managed-runtime.ts feat(sandbox): stage referenced projects into the run sandbox (#10469) 2026-07-29 16:09:57 -07:00
runtime-progress.test.ts feat(adapter-utils): add observable sandbox sync progress (#8395) 2026-06-20 13:03:42 -07:00
runtime-progress.ts Improve live agent feedback during sandboxed runs (#8915) 2026-07-02 22:21:56 -07:00
sandbox-callback-bridge.test.ts feat(observability): rename sandbox provider spans and add run-time wrapper spans (#10999) 2026-08-06 22:31:15 -07:00
sandbox-callback-bridge.ts feat(acp): stream Daytona sandbox agent output and remove the host output poll (#11049) 2026-08-07 14:29:58 -07:00
sandbox-file-sync.test.ts feat(sandbox): stage referenced projects into the run sandbox (#10469) 2026-07-29 16:09:57 -07:00
sandbox-install-command.test.ts Fix exe.dev sandbox installs for gemini/opencode local adapters (#5737) 2026-05-11 14:28:22 -07:00
sandbox-install-command.ts Fix exe.dev sandbox installs for gemini/opencode local adapters (#5737) 2026-05-11 14:28:22 -07:00
sandbox-managed-runtime.test.ts feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072) 2026-08-07 17:47:30 -07:00
sandbox-managed-runtime.ts feat(adapter-utils): add host-side pack span to managed-runtime tarball build (#11072) 2026-08-07 17:47:30 -07:00
sandbox-run-log-stream.ts Improve live agent feedback during sandboxed runs (#8915) 2026-07-02 22:21:56 -07:00
sandbox-shell.ts Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
server-utils-env.test.ts fix: preserve control plane access in Codex sandbox (#10152) 2026-07-24 15:25:59 -05:00
server-utils.test.ts feat(settings): add experimental Simplified English Interactions flag (#10934) 2026-08-05 21:50:41 -05:00
server-utils.ts feat(settings): add experimental Simplified English Interactions flag (#10934) 2026-08-05 21:50:41 -05:00
session-compaction.ts Make ACP the default engine for local adapters (#9238) 2026-07-08 19:05:03 -07:00
ssh-fixture.test.ts perf(sandbox-providers): drop nvm sourcing from exec wrappers (#10443) 2026-07-29 12:40:16 -07:00
ssh.ts fix(adapter-utils): carry the workspace origin remote into transported git workspaces (#10873) 2026-08-05 10:24:01 -07:00
types.ts feat(heartbeat): expose cache-adjusted run cost (#10349) 2026-08-01 07:15:52 -07:00
workspace-restore-merge.test.ts refactor(codex-local): relocate Codex auth-merge scripts + decision predicate into the adapter (#9785) 2026-07-17 14:45:36 -05:00
workspace-restore-merge.ts Fix sandbox restore index drift (#8595) 2026-06-24 23:21:13 -07:00