fix: migrate SDK Pi integration for v0.68.1#1402
Conversation
|
The latest Agentuity deployment details.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 58 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated dependencies; introduced name-allowlist sub-agent tool selection with fallback and strict modes; added selectSubAgentToolNames and tests; extended AgentDefinition/schema with Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-migrate-2.0.9-707ba81.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-cli-2.0.9-707ba81.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-frontend-2.0.9-707ba81.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-react-2.0.9-707ba81.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-drizzle-2.0.9-707ba81.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-keyvalue-2.0.9-707ba81.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-email-2.0.9-707ba81.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schema-2.0.9-707ba81.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-vector-2.0.9-707ba81.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-server-2.0.9-707ba81.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-db-2.0.9-707ba81.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-sandbox-2.0.9-707ba81.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-task-2.0.9-707ba81.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schedule-2.0.9-707ba81.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-postgres-2.0.9-707ba81.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-workbench-2.0.9-707ba81.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-opencode-2.0.9-707ba81.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-core-2.0.9-707ba81.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-webhook-2.0.9-707ba81.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-evals-2.0.9-707ba81.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-2.0.9-707ba81.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-auth-2.0.9-707ba81.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-runtime-2.0.9-707ba81.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-tui-2.0.9-707ba81.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-claude-code-2.0.9-707ba81.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-queue-2.0.9-707ba81.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-migrate-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-cli-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-frontend-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-react-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-drizzle-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-keyvalue-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-email-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schema-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-vector-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-server-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-db-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-sandbox-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-task-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schedule-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-postgres-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-workbench-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-opencode-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-core-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-webhook-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-evals-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-auth-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-runtime-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-tui-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-claude-code-2.0.9-707ba81.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-queue-2.0.9-707ba81.tgz |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/coder-tui/src/subagent-tool-selection.ts`:
- Line 1: The file subagent-tool-selection.ts is misformatted; run the project's
formatter to normalize whitespace and imports (e.g., run "bunx biome format
--write" for that file) so the import of AgentDefinition and any surrounding
code match the biome formatting rules and CI will pass.
In `@packages/coder-tui/test/subagent-tool-selection.test.ts`:
- Around line 1-3: The test file is failing CI due to formatting differences;
run the project formatter (e.g., `bunx biome format --write
packages/coder-tui/test/subagent-tool-selection.test.ts`) or your repository's
standard formatting command to reformat the file so its contents match the
expected style, then re-run lint/CI; ensure imports and spacing in the file with
symbols describe/expect/it and selectSubAgentToolNames are preserved after
formatting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f8d34192-7bd6-4ccc-a44e-da97c7740739
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
packages/coder-tui/package.jsonpackages/coder-tui/src/index.tspackages/coder-tui/src/protocol.tspackages/coder-tui/src/subagent-tool-selection.tspackages/coder-tui/test/subagent-tool-selection.test.tspackages/core/src/services/coder/protocol.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
- GitHub Check: Pack & Upload
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: Package Installation & Usage Test
- GitHub Check: Queue CLI Tests
- GitHub Check: Storage CLI Tests
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Template Integration Tests
- GitHub Check: Cloud Deployment Tests
- GitHub Check: Standalone Agent Test
- GitHub Check: Build
- GitHub Check: Framework Integration Tests (TanStack & Next.js)
- GitHub Check: Playwright E2E Smoke Test
- GitHub Check: Sandbox CLI Tests
- GitHub Check: SDK Integration Test Suite
- GitHub Check: Queue SDK Tests
- GitHub Check: Agentuity Deployment
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use Biome as code formatter with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/core/src/services/coder/protocol.tspackages/coder-tui/test/subagent-tool-selection.test.tspackages/coder-tui/src/index.tspackages/coder-tui/src/protocol.tspackages/coder-tui/src/subagent-tool-selection.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript Strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/core/src/services/coder/protocol.tspackages/coder-tui/test/subagent-tool-selection.test.tspackages/coder-tui/src/index.tspackages/coder-tui/src/protocol.tspackages/coder-tui/src/subagent-tool-selection.ts
packages/core/src/**/*.ts
📄 CodeRabbit inference engine (packages/core/AGENTS.md)
packages/core/src/**/*.ts: Build TypeScript withbun run buildcommand
Run TypeScript type checking withbun run typecheckcommand
Ensure runtime compatibility with both Browser and Node/Bun environments with no runtime-specific code
Build target must be ESNext with TypeScript declaration files
Prefer interfaces for public APIs
Use generics for reusable type utilities
Ensure no side effects in all exports - all exports must be pure with no global mutations
All relative imports in TypeScript files MUST include the.tsextension
Runbun run buildbefore publishing to compile TypeScript
Files:
packages/core/src/services/coder/protocol.ts
**/test/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/test/**/*.{ts,tsx}: Place tests intest/folder, never insrc/or__tests__/directories
Import from../src/in test files
Use@agentuity/test-utilsfor mocks in tests
Files:
packages/coder-tui/test/subagent-tool-selection.test.ts
**/index.ts
📄 CodeRabbit inference engine (AGENTS.md)
Use named exports from package
index.tsfiles
Files:
packages/coder-tui/src/index.ts
🧠 Learnings (3)
📚 Learning: 2026-03-27T23:18:58.450Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1292
File: packages/keyvalue/package.json:3-3
Timestamp: 2026-03-27T23:18:58.450Z
Learning: In the agentuity/sdk monorepo, subpackage `package.json` files under `packages/` (e.g., `packages/keyvalue`) are allowed to depend on other workspace packages (such as `agentuity/server`) and are not limited to only `agentuity/core` and `zod`. Also, if a subpackage uses `bunx tsc --build --force` as its build script, treat it as a valid/intentional build command and do not flag it as a dependency/build-script violation.
Applied to files:
packages/coder-tui/package.json
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/core/src/services/coder/protocol.tspackages/coder-tui/test/subagent-tool-selection.test.tspackages/coder-tui/src/index.tspackages/coder-tui/src/protocol.tspackages/coder-tui/src/subagent-tool-selection.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.
Applied to files:
packages/coder-tui/test/subagent-tool-selection.test.ts
🪛 GitHub Check: Format & Lint
packages/coder-tui/test/subagent-tool-selection.test.ts
[failure] 1-1: format
File content differs from formatting output
packages/coder-tui/src/subagent-tool-selection.ts
[failure] 1-1: format
File content differs from formatting output
🔇 Additional comments (9)
packages/core/src/services/coder/protocol.ts (1)
73-76: LGTM!The new
sourceandstrictToolSelectionoptional fields are well-placed and properly documented with.describe()annotations. These additions align with the corresponding interface changes inpackages/coder-tui/src/protocol.tsand support the new tool-name allowlist behavior.Also applies to: 106-109
packages/coder-tui/src/protocol.ts (1)
78-78: LGTM!The interface additions for
sourceandstrictToolSelectionare correctly typed as optional fields and maintain consistency with theAgentDefinitionSchemainpackages/core/src/services/coder/protocol.ts.Also applies to: 88-88
packages/coder-tui/src/index.ts (4)
1786-1795: LGTM — Explicit agentDir for DefaultResourceLoader.The change correctly captures
cwdandagentDirseparately and passes both toDefaultResourceLoader. This aligns with Pi v0.68.x requirements where the resource loader needs an explicitagentDirparameter for proper path resolution.
1814-1819: Clean tool-name allowlist construction.The migration from
Tool[]instances to a tool-name allowlist is well-implemented:
- Built-in tools are selected via
selectSubAgentToolNames(agentConfig)- Hub tool names are extracted and filtered for non-empty strings
- Both lists are merged and deduplicated using
Set
1833-1834: Good improvement: SessionManager bound to repository cwd.Changing from
SessionManager.inMemory('/tmp')toSessionManager.inMemory(cwd)ensures the in-memory sub-agent session is tied to the actual repository working directory, which is necessary for Pi v0.68.x session tracking.
1759-1764: No issues identified. ThegetAgentDirfunction is correctly exported from@mariozechner/pi-coding-agentand appropriately destructured from the Pi SDK for use withDefaultResourceLoader.packages/coder-tui/test/subagent-tool-selection.test.ts (1)
16-55: Good test coverage for tool selection logic.The test suite covers the key behavioral scenarios:
- Read-only baseline selection
- Bash declaration forcing coding baseline
- Legacy fallback for non-strict agents
- Strict mode preventing tool widening
- Default coding baseline for non-read-only agents
packages/coder-tui/src/subagent-tool-selection.ts (1)
10-33: Well-structured tool selection logic.The implementation correctly handles:
- Normalization for case-insensitive tool name matching
- Special
bashdetection to force coding tools even for read-only agents- Strict mode respecting explicit tool declarations without fallback widening
- Non-strict legacy behavior with baseline fallback
The logic flow is clear and the function is properly typed.
packages/coder-tui/package.json (1)
28-33: Pi package versions (^0.68.1) are all published on npm.All three packages (
@mariozechner/pi-coding-agent,@mariozechner/pi-tui,@mariozechner/pi-ai) at version 0.68.1 exist and are ready for use.
Summary
This migrates the SDK-side Pi integration to
v0.68.1.Pi
0.68.xchanged sub-agent/session tool configuration from built-inTool[]instances to tool-name allowlists and made direct resource-loader construction require explicitagentDir. This PR updatescoder-tuifor that runtime change and keeps the programmatic coder schemas aligned in@agentuity/core/coder.What Changed
@agentuity/coder-tuiPi dependencies to^0.68.1bun.lockagentDirto directDefaultResourceLoader(...)construction incoder-tui@agentuity/core/coderAgentDefinitionSchemawith Hub metadata by includingsourceandstrictToolSelectionPI_TELEMETRY=0still applies to interactive startup)Validation
bun run --filter='./packages/coder-tui' typecheckbun run --filter='./packages/coder-tui' buildbun test packages/coder-tui/testbun run --filter='./packages/cli' typecheckbun run --filter='./packages/cli' buildbun run --filter='./packages/core' typecheckbun run --filter='./packages/core' buildbun run --filter='./packages/coder' typecheckbun run --filter='./packages/coder' buildagentuity coder startbooted Piv0.68.1agentuity coder start --remotesuccessfully hydrated the live sandbox sessionNotes
packages/coderitself remains Pi-free.coder-tui; the core/package-level change here is schema alignment for programmatic consumers.Summary by CodeRabbit
Chores
New Features
Tests