fix: orchestrator button + Pi SDK session error
- Move leftSidebarMode from URL state to local useState in unified-shell,
avoiding force-dynamic router round-trip that made the button appear broken - Replace fileURLToPath(new URL(..., import.meta.url)) with process.cwd()
in bb-pi-bootstrap.ts — import.meta.url is a webpack:// URL in Next.js,
causing cross-realm TypeError when passed to Node.js fileURLToPath()
This commit is contained in:
parent
643fa299dd
commit
d335e5bf71
98 changed files with 17851 additions and 944 deletions
95
docs/plans/2026-03-07-phase-7-tests.md
Normal file
95
docs/plans/2026-03-07-phase-7-tests.md
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
# Phase 7 - Tests and Verification
|
||||
|
||||
**Status:** Planning
|
||||
**Created:** 2026-03-07
|
||||
**Goal:** Add comprehensive tests for embedded Pi runtime and agent system
|
||||
|
||||
---
|
||||
|
||||
## Test Categories
|
||||
|
||||
### 1. Unit Tests
|
||||
|
||||
**Runtime Path Resolution:**
|
||||
- `pi-runtime-detection.test.ts` - SDK detection, path resolution
|
||||
- `bb-pi-bootstrap.test.ts` - bootstrap process
|
||||
|
||||
**Event Projection:**
|
||||
- `embedded-daemon.test.ts` - event emission, deduplication
|
||||
- `orchestrator-chat.test.ts` - message projection
|
||||
|
||||
**Worker Session:**
|
||||
- `worker-session-manager.test.ts` - spawn, status, lifecycle
|
||||
|
||||
### 2. Contract Tests
|
||||
|
||||
**Adapter Schemas:**
|
||||
- Pi SDK adapter input/output contracts
|
||||
- Runtime event schema validation
|
||||
|
||||
### 3. Integration Tests
|
||||
|
||||
**Orchestrator Flow:**
|
||||
- Session creation
|
||||
- Prompt submission
|
||||
- Tool execution
|
||||
- Response handling
|
||||
|
||||
**Worker Flow:**
|
||||
- Worker spawn
|
||||
- Bead claim/update/close
|
||||
- Result retrieval
|
||||
|
||||
### 4. UI Tests
|
||||
|
||||
**Left Panel:**
|
||||
- Chat rendering
|
||||
- Message projection
|
||||
- Error display
|
||||
|
||||
---
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
### Step 1: Unit Test Setup
|
||||
- Configure test runner (Jest or Vitest)
|
||||
- Create test utilities for mocking Pi SDK
|
||||
|
||||
**Files:**
|
||||
- `tests/setup.ts`
|
||||
- `tests/mocks/pi-sdk.ts`
|
||||
|
||||
### Step 2: Runtime Unit Tests
|
||||
- Test path detection
|
||||
- Test bootstrap process
|
||||
- Test event deduplication
|
||||
|
||||
### Step 3: Worker Unit Tests
|
||||
- Test spawn flow
|
||||
- Test status tracking
|
||||
- Test result collection
|
||||
|
||||
### Step 4: Integration Tests
|
||||
- Test full orchestrator flow
|
||||
- Test worker-to-bead workflow
|
||||
|
||||
---
|
||||
|
||||
## Blocked Items
|
||||
|
||||
None identified.
|
||||
|
||||
---
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- [ ] Unit tests for runtime components pass
|
||||
- [ ] Unit tests for worker session manager pass
|
||||
- [ ] Integration tests for orchestrator flow pass
|
||||
- [ ] Integration tests for worker flow pass
|
||||
|
||||
---
|
||||
|
||||
## Estimated Effort
|
||||
|
||||
4-5 hours
|
||||
Loading…
Add table
Add a link
Reference in a new issue