Skip to content

slack: start a conversation's thread on the project's connected machine (BB-38) - #67

Merged
trotterdylan merged 1 commit into
mainfrom
bb/let-s-wire-up-the-slack-secrets-for-the-slack-bb-thr_88i5b2serf
Oct 23, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/let-s-wire-up-the-slack-secrets-for-the-slack-bb-thr_88i5b2serf

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

BB-38 (https://linear.app/bit-complete/issue/BB-38). With bb-gate#30 in, a DM now routes and wakes the right server, but the first reply was the backstop:

Your bb could not start or continue a thread for this Slack conversation: HTTP 502: Local host daemon is not initialized

Cause. spawnThread passed environment: { type: "project-default" }. Per the SDK that seeds nothing and expects the composer to resolve the default; from a plugin nobody does, so bb fell back to the server's own local host, which on a bb-gate pod has no daemon.

Fix. environmentFor(project) chooses a concrete environment on a connected machine, in order:

  1. The project's newest active environment whose machine is connected: its provider and inputs are replayed on that machine ({ type: "provider", environmentProviderId, inputs, machine: { type: "existing", hostId } }). This follows whatever the developer actually uses (multi-repo workspaces here).
  2. The project's checkout (project-checkout, or personal-workspace for the personal project) on the default source's machine, skipping a default source whose machine is off for one that is on, as stewards' projectHost does.
  3. project-default only when the project has no connected machine at all.

Tests: the harness now stubs hosts.list, projects.get and environments.list; the first-wake test asserts the replayed provider, and three new cases cover the checkout fallback, the off-machine default source, and the no-machine case. tsc --noEmit and vitest run green (37 tests).

Lane: no-review. A narrow bug fix making the plugin do what it was meant to do; no contract, setting or identity change.

On merge: the bb-gate bb-server workflow re-pins bb-plugins main within ten minutes and builds a new image; the router stages it on every developer's server, picked up on Restart now or in the quiet window. Do not press Restart now from a thread you still need.

🤖 Generated with Claude Code

…ne (BB-38)

The first real DM to the bb app answered "HTTP 502: Local host daemon is
not initialized". The plugin spawned the thread with
`environment: { type: "project-default" }`, which a plugin cannot use
the way the composer does: nothing resolves the default, so bb fell back
to the server's own local host, and on a bb-gate pod that daemon never
exists.

Pick the machine the way stewards does, and the environment the way the
developer does: replay the provider and inputs of the project's newest
active environment on its machine when that machine is connected; else
the project's checkout (personal workspace for the personal project) on
the default source's connected machine; and leave it to bb only when the
project has no connected machine at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@trotterdylan
trotterdylan merged commit 77e3072 into main Oct 23, 2026
20 checks passed
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