Skip to content

fix(hive): seed Pi with positional bootstrap prompt - #560

Merged
chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
HsienW:fix/pi-initial-prompt-bootstrap
Oct 2, 2026
Merged

chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
HsienW:fix/pi-initial-prompt-bootstrap

Conversation

@HsienW

@HsienW HsienW commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

What & why

Pi agents currently spawn without the hive bootstrap because the provider preset does not declare how the initial prompt should be delivered. This leaves a fresh Pi session with no role, protocol, or inbox context until a later dispatch arrives.

This change declares Pi's existing positional initial prompt contract so the full bootstrap is passed as a single argv value on fresh spawn. It also tightens the shared provider contract and adds regressions for bootstrap delivery and bridge installation failure without introducing a Pi specific spawn path or touching Pi's private session storage.

Closes #558

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Build / CI

Evidence

Before

Pi could receive hive inbox messages, but its provider preset declared no bootstrap delivery strategy. A fresh Pi agent therefore reached the generic bare spawn fallback.

The regression guard reproduces the missing contract when positionalInitialPrompt is removed:

2026-09-19-163809

Suggested screenshot content:

pi can receive hive inbox but declares no bootstrap delivery path

This demonstrates that the shared provider guard fails when Pi has inbox capability but no initial bootstrap path.

After

Pi now explicitly declares positional initial prompt delivery. The full multiline bootstrap is passed as one positional argv value during a fresh spawn.

The Pi bootstrap regression also verifies that a bridge installation failure does not prevent bootstrap delivery and that the bridge error remains observable.

2026-09-19-163933

Suggested screenshot content:

tests 12
pass 12
fail 0

The final Pi and provider regression set passes 12/12.

How I tested it

  • OS: Windows 11
  • Steps:
node --test test/provider-config.test.cjs test/hive-pi-bootstrap.test.cjs

Result:

12/12 passed

The broader related regression set also passes:

40/40 passed

Additional validation:

npm run typecheck
npm run build
git diff --check

Results:

npm run typecheck: PASS
npm run build: PASS
git diff --check: PASS

I also ran the full focused suite:

npm run test:focused

The full focused suite is not completely green on Windows. The remaining failures are in Windows symlink EPERM, HOME isolation, and existing source pattern tests outside the Pi bootstrap paths changed by this PR.

The issue focused Pi and provider tests are green, and no Pi specific Windows handling was added.

Boundary coverage

The implementation intentionally stays on the existing provider bootstrap contract:

  • Pi uses the upstream pi [options] [messages...] positional message interface.
  • The complete multiline bootstrap is delivered as one positional argv value.
  • No Pi specific spawn branch or Windows command workaround is introduced.
  • Bridge installation failure does not suppress bootstrap delivery.
  • --session and the positional bootstrap remain independent argv entries and do not require provider specific argument reordering.
  • No Pi session JSONL files are read, written, repaired, or parsed.
  • Partial JSON, unterminated JSONL records, file locking, and upstream session schema changes therefore remain outside this fix.
  • Mailbox watcher work and doctor diagnostics remain separate follow ups rather than expanding the root cause fix.

Checklist

  • Before and after evidence is attached above, under both headings.
  • npm run typecheck passes.
  • npm run test:focused passes.
    • The issue focused regressions pass 40/40 and the final Pi/provider set passes 12/12.
    • The remaining full suite failures are Windows symlink EPERM, HOME isolation, and existing source pattern failures outside this change.
  • npm run build succeeds.
  • This PR is one change. Unrelated fixes belong in their own PR.
  • I read the diff myself before opening this, and there is no debug output, commented out code, or unrelated formatting churn in it.
  • Any new UI derives from DESIGN.md / tokens.ts with no ad hoc colors, spacing, or fonts.
    • No UI changes in this PR.
  • If I added art, it's my own or compatibly licensed, and listed in ATTRIBUTION.md.
    • No art added in this PR.

- Declare Pi's positional initial-prompt delivery so fresh agents receive the full hive bootstrap instead of spawning bare.

- Also tighten the generic provider bootstrap contract, add Pi regressions for single-argv delivery and bridge-install failure, and document intentional bare-spawn behavior for providers without a seed strategy.
@chaitanyagiri
chaitanyagiri merged commit 1e7265d into HarnessMD:main Oct 2, 2026
3 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.

[BUG] PI provider agents receive no bootstrap on spawn

2 participants