Skip to content

fix: migrate SDK Pi integration for v0.68.1#1402

Merged
rblalock merged 4 commits intomainfrom
review/pi-v0.68
Apr 22, 2026
Merged

fix: migrate SDK Pi integration for v0.68.1#1402
rblalock merged 4 commits intomainfrom
review/pi-v0.68

Conversation

@rblalock
Copy link
Copy Markdown
Member

@rblalock rblalock commented Apr 22, 2026

Summary

This migrates the SDK-side Pi integration to v0.68.1.

Pi 0.68.x changed sub-agent/session tool configuration from built-in Tool[] instances to tool-name allowlists and made direct resource-loader construction require explicit agentDir. This PR updates coder-tui for that runtime change and keeps the programmatic coder schemas aligned in @agentuity/core/coder.

What Changed

  • bump @agentuity/coder-tui Pi dependencies to ^0.68.1
  • refresh bun.lock
  • migrate local sub-agent tool selection to built-in tool-name allowlists
  • pass explicit agentDir to direct DefaultResourceLoader(...) construction in coder-tui
  • bind in-memory sub-agent sessions to the actual repo cwd
  • add shared sub-agent tool-selection coverage for the new allowlist behavior
  • align @agentuity/core/coder AgentDefinitionSchema with Hub metadata by including source and strictToolSelection
  • leave CLI telemetry behavior unchanged (PI_TELEMETRY=0 still applies to interactive startup)

Validation

  • bun run --filter='./packages/coder-tui' typecheck
  • bun run --filter='./packages/coder-tui' build
  • bun test packages/coder-tui/test
  • bun run --filter='./packages/cli' typecheck
  • bun run --filter='./packages/cli' build
  • bun run --filter='./packages/core' typecheck
  • bun run --filter='./packages/core' build
  • bun run --filter='./packages/coder' typecheck
  • bun run --filter='./packages/coder' build
  • live smoke
    • local agentuity coder start booted Pi v0.68.1
    • remote agentuity coder start --remote successfully hydrated the live sandbox session

Notes

  • packages/coder itself remains Pi-free.
  • The runtime-sensitive migration work stays in coder-tui; the core/package-level change here is schema alignment for programmatic consumers.

Summary by CodeRabbit

  • Chores

    • Updated agent framework dependencies to v0.68.1.
    • Sub-agent sessions and resource loading now use the repository working directory.
  • New Features

    • Support for designating agents as built-in or custom.
    • Optional strict tool-selection mode to constrain available tools.
    • Improved tool-selection behavior for read-only vs coding agents.
  • Tests

    • Added tests covering agent tool-selection scenarios.

@agentuity-agent
Copy link
Copy Markdown

agentuity-agent Bot commented Apr 22, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🔴 Failed (deploy_da4bc2e9fdb216c860e0d413fdcf7413) - 2026-04-22T16:35:58Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@rblalock has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 58 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3ef00232-0ec3-4b17-bbb9-24e21a69078a

📥 Commits

Reviewing files that changed from the base of the PR and between bdc275f and 707ba81.

📒 Files selected for processing (2)
  • packages/coder-tui/src/index.ts
  • packages/core/src/services/coder/protocol.ts
📝 Walkthrough

Walkthrough

Updated dependencies; introduced name-allowlist sub-agent tool selection with fallback and strict modes; added selectSubAgentToolNames and tests; extended AgentDefinition/schema with source and strictToolSelection; updated sub-agent session/environment setup to use repository cwd and agentDir.

Changes

Cohort / File(s) Summary
Dependency Updates
packages/coder-tui/package.json
Bumped @mariozechner/pi-coding-agent and @mariozechner/pi-tui from ^0.67.68^0.68.1; bumped devDependency @mariozechner/pi-ai similarly.
Protocol Types & Schema
packages/coder-tui/src/protocol.ts, packages/core/src/services/coder/protocol.ts
Added optional fields to AgentDefinition / AgentDefinitionSchema: `source?: 'builtin'
Tool Selection Implementation
packages/coder-tui/src/subagent-tool-selection.ts
New export selectSubAgentToolNames(agentConfig) implementing normalized name allowlist, read-only vs coding base lists, bash handling, and fallback/strict-selection behavior.
Integration - Subagent Session & Env
packages/coder-tui/src/index.ts
Replaced binary read-only/coding tool selection with selectSubAgentToolNames; compute builtInToolNames and merge with hub tool names; pass cwd and agentDir to DefaultResourceLoader and use SessionManager.inMemory(cwd).
Tests
packages/coder-tui/test/subagent-tool-selection.test.ts
Added Bun test suite covering selection outcomes across read-only, coding, builtin/custom, and strict/non-strict scenarios.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

📦 Canary Packages Published

version: 2.0.9-707ba81

Packages
Package Version URL
@agentuity/migrate 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-migrate-2.0.9-707ba81.tgz
@agentuity/cli 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-cli-2.0.9-707ba81.tgz
@agentuity/frontend 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-frontend-2.0.9-707ba81.tgz
@agentuity/react 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-react-2.0.9-707ba81.tgz
@agentuity/drizzle 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-drizzle-2.0.9-707ba81.tgz
@agentuity/keyvalue 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-keyvalue-2.0.9-707ba81.tgz
@agentuity/email 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-email-2.0.9-707ba81.tgz
@agentuity/schema 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schema-2.0.9-707ba81.tgz
@agentuity/vector 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-vector-2.0.9-707ba81.tgz
@agentuity/server 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-server-2.0.9-707ba81.tgz
@agentuity/db 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-db-2.0.9-707ba81.tgz
@agentuity/sandbox 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-sandbox-2.0.9-707ba81.tgz
@agentuity/task 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-task-2.0.9-707ba81.tgz
@agentuity/schedule 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-schedule-2.0.9-707ba81.tgz
@agentuity/postgres 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-postgres-2.0.9-707ba81.tgz
@agentuity/workbench 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-workbench-2.0.9-707ba81.tgz
@agentuity/opencode 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-opencode-2.0.9-707ba81.tgz
@agentuity/core 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-core-2.0.9-707ba81.tgz
@agentuity/webhook 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-webhook-2.0.9-707ba81.tgz
@agentuity/evals 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-evals-2.0.9-707ba81.tgz
@agentuity/coder 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-2.0.9-707ba81.tgz
@agentuity/auth 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-auth-2.0.9-707ba81.tgz
@agentuity/runtime 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-runtime-2.0.9-707ba81.tgz
@agentuity/coder-tui 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-coder-tui-2.0.9-707ba81.tgz
@agentuity/claude-code 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-claude-code-2.0.9-707ba81.tgz
@agentuity/queue 2.0.9-707ba81 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-707ba81/agentuity-queue-2.0.9-707ba81.tgz
Install

Add to your package.json:

{
  "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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ceab8c and caf83c8.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • packages/coder-tui/package.json
  • packages/coder-tui/src/index.ts
  • packages/coder-tui/src/protocol.ts
  • packages/coder-tui/src/subagent-tool-selection.ts
  • packages/coder-tui/test/subagent-tool-selection.test.ts
  • packages/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.ts
  • packages/coder-tui/test/subagent-tool-selection.test.ts
  • packages/coder-tui/src/index.ts
  • packages/coder-tui/src/protocol.ts
  • packages/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
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/core/src/services/coder/protocol.ts
  • packages/coder-tui/test/subagent-tool-selection.test.ts
  • packages/coder-tui/src/index.ts
  • packages/coder-tui/src/protocol.ts
  • packages/coder-tui/src/subagent-tool-selection.ts
packages/core/src/**/*.ts

📄 CodeRabbit inference engine (packages/core/AGENTS.md)

packages/core/src/**/*.ts: Build TypeScript with bun run build command
Run TypeScript type checking with bun run typecheck command
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 .ts extension
Run bun run build before 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 in test/ folder, never in src/ or __tests__/ directories
Import from ../src/ in test files
Use @agentuity/test-utils for 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.ts files

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.ts
  • packages/coder-tui/test/subagent-tool-selection.test.ts
  • packages/coder-tui/src/index.ts
  • packages/coder-tui/src/protocol.ts
  • packages/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 source and strictToolSelection optional fields are well-placed and properly documented with .describe() annotations. These additions align with the corresponding interface changes in packages/coder-tui/src/protocol.ts and 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 source and strictToolSelection are correctly typed as optional fields and maintain consistency with the AgentDefinitionSchema in packages/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 cwd and agentDir separately and passes both to DefaultResourceLoader. This aligns with Pi v0.68.x requirements where the resource loader needs an explicit agentDir parameter for proper path resolution.


1814-1819: Clean tool-name allowlist construction.

The migration from Tool[] instances to a tool-name allowlist is well-implemented:

  1. Built-in tools are selected via selectSubAgentToolNames(agentConfig)
  2. Hub tool names are extracted and filtered for non-empty strings
  3. Both lists are merged and deduplicated using Set

1833-1834: Good improvement: SessionManager bound to repository cwd.

Changing from SessionManager.inMemory('/tmp') to SessionManager.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. The getAgentDir function is correctly exported from @mariozechner/pi-coding-agent and appropriately destructured from the Pi SDK for use with DefaultResourceLoader.

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 bash detection 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.

Comment thread packages/coder-tui/src/subagent-tool-selection.ts
Comment thread packages/coder-tui/test/subagent-tool-selection.test.ts
@rblalock rblalock requested a review from jhaynie April 22, 2026 15:47
@rblalock rblalock enabled auto-merge (squash) April 22, 2026 15:55
@rblalock rblalock disabled auto-merge April 22, 2026 17:44
@rblalock rblalock merged commit c88fe8d into main Apr 22, 2026
14 of 19 checks passed
@rblalock rblalock deleted the review/pi-v0.68 branch April 22, 2026 17:44
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