Skip to content

Pass saved machine variables to repository setup - #3559

Merged
ymichael merged 1 commit into
mainfrom
bb/fixer-deliver-machine-variables-to-normal-reposi-thr_7xicu7evcb
Sep 12, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fixer-deliver-machine-variables-to-normal-reposi-thr_7xicu7evcb

Conversation

@ymichael

@ymichael ymichael commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Variables saved in Machine environment were omitted from ordinary repository setup. A script needing a configured token could fail even though BB had saved the value correctly. The machine-environment support in PR #3274 supplied explicit hooks, but normal setup ran through environment.attach without those values.

What changed

Resolve fresh machine variables on the server when dispatching setup, then pass them transiently through environment.attach into the existing setup runner. The retained provisioning request stays free of plaintext values. Existing encryption, precedence, cancellation and recovery behavior remain; unmanaged attached paths still skip setup.

Adds the validated attach contribution field and bumps host-daemon protocol 204 → 205, requiring older daemons to update. Updates the configuration documentation, machine CLI guide and bb-cli reference. No new user-facing setting or CLI command.

How you verified

  • Server-delivery and setup-shell regressions failed before the fix and pass afterward.
  • 146 tests pass: 57 server, 30 daemon, 56 contract and 3 integration tests. Coverage includes fresh values on repeated dispatch, local-host exclusion, encrypted storage, retained request/state privacy, missing-key failure, cancellation with duplicate attaches, explicit hooks, cloning and old-protocol rejection.
  • Turbo builds and typechecks passed for @bb/server, @bb/host-daemon and @bb/host-daemon-contract; formatting and diff checks passed.
  • Started pnpm start:worktree, configured Modal, and created a test thread through the BB CLI. A real Modal sandbox installed this server’s daemon, cloned a disposable repository, and ran ordinary setup. Setup required a configured test variable and wrote a receipt; the live Codex thread read the receipt and returned PASS. The initial byte comparison omitted the receipt’s trailing newline; the corrected check passed without changing the file.

Focused commands:

pnpm exec turbo run test --filter=@bb/server -- test/hosts/live-command.test.ts test/internal/internal-session-protocol-version.test.ts test/services/environments/provider-orchestration.test.ts src/services/hosts/host-environment.test.ts
pnpm exec turbo run test --filter=@bb/host-daemon -- test/command/environment-dispatch.test.ts test/command/environment-hook.test.ts test/command/command-router.test.ts test/command/project-clone-private-env.test.ts src/operation-environment.test.ts
pnpm exec turbo run test --filter=@bb/host-daemon-contract
pnpm exec turbo run test --filter=@bb/integration-tests -- fake/environments/environment-attach-recovery.test.ts
pnpm exec turbo run build typecheck --filter=@bb/server --filter=@bb/host-daemon --filter=@bb/host-daemon-contract
pnpm exec turbo run build typecheck lint --cache-dir=.turbo/cache --output-logs=new-only --concurrency=4

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/fixer-deliver-machine-variables-to-normal-reposi-thr_7xicu7evcb branch from ba58b58 to 209411a Compare September 12, 2026 03:33
@ymichael
ymichael force-pushed the bb/fixer-deliver-machine-variables-to-normal-reposi-thr_7xicu7evcb branch from 209411a to c6313e5 Compare September 12, 2026 03:38
@ymichael
ymichael merged commit c485b92 into main Sep 12, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fixer-deliver-machine-variables-to-normal-reposi-thr_7xicu7evcb branch September 12, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant