fix(cli): support explicit project config paths#1435
Conversation
|
The latest Agentuity deployment details.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent 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). (15)
🧰 Additional context used📓 Path-based instructions (4)packages/cli/**/*.ts📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/test/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-12-21T00:31:41.858ZApplied to files:
📚 Learning: 2026-02-21T02:05:57.982ZApplied to files:
📝 WalkthroughWalkthroughRefactors project-config resolution by adding ChangesProject Config Path Resolution
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 0/5 reviews remaining, refill in 54 minutes and 1 second. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-task-2.0.12-fed2641.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-email-2.0.12-fed2641.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-migrate-2.0.12-fed2641.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-coder-2.0.12-fed2641.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-cli-2.0.12-fed2641.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-postgres-2.0.12-fed2641.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-server-2.0.12-fed2641.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-sandbox-2.0.12-fed2641.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-coder-tui-2.0.12-fed2641.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-webhook-2.0.12-fed2641.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-frontend-2.0.12-fed2641.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-keyvalue-2.0.12-fed2641.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-evals-2.0.12-fed2641.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-core-2.0.12-fed2641.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-drizzle-2.0.12-fed2641.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-db-2.0.12-fed2641.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-claude-code-2.0.12-fed2641.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-react-2.0.12-fed2641.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-schema-2.0.12-fed2641.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-queue-2.0.12-fed2641.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-auth-2.0.12-fed2641.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-opencode-2.0.12-fed2641.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-schedule-2.0.12-fed2641.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-vector-2.0.12-fed2641.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-runtime-2.0.12-fed2641.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-workbench-2.0.12-fed2641.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-task-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-email-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-migrate-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-coder-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-cli-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-postgres-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-server-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-sandbox-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-coder-tui-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-webhook-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-frontend-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-keyvalue-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-evals-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-core-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-drizzle-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-db-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-claude-code-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-react-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-schema-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-queue-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-auth-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-opencode-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-schedule-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-vector-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-runtime-2.0.12-fed2641.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.12-fed2641/agentuity-workbench-2.0.12-fed2641.tgz |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cli/src/config.ts (1)
767-775: ⚡ Quick winUse the typed project-config error in
updateProjectConfig()as well.Now that this path can target explicit JSON files too, Line 774 still throwing a plain
Errordrops theconfigPath/explicitmetadata thatloadProjectConfig()andcli.tsuse for clearPROJECT_NOT_FOUNDhandling. That makes mutation flows inconsistent with the new resolver behavior.♻️ Suggested change
const file = Bun.file(configPath); if (!(await file.exists())) { - throw new Error(`Project config not found at ${configPath}`); + throw new ProjectConfigNotFoundException({ + message: `Project config not found at ${configPath}`, + configPath, + explicit: resolved.explicitConfigFile, + }); }As per coding guidelines "Use
StructuredErrorfrom@agentuity/corefor error handling".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/src/config.ts` around lines 767 - 775, The current throw in updateProjectConfig() uses a plain Error which loses the structured metadata expected by loadProjectConfig() and cli.ts; replace that throw with a StructuredError (from `@agentuity/core`) carrying the PROJECT_NOT_FOUND code and include the configPath plus the explicit flag (use resolved.configPath and resolved.explicitConfigFile) so callers can inspect { configPath, explicit } like loadProjectConfig() does; locate the logic around resolveProjectConfigPaths, loadedProjectConfigPaths and the file.exists() check and swap the Error for a StructuredError with the same message and the extra metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/cli/src/config.ts`:
- Around line 767-775: The current throw in updateProjectConfig() uses a plain
Error which loses the structured metadata expected by loadProjectConfig() and
cli.ts; replace that throw with a StructuredError (from `@agentuity/core`)
carrying the PROJECT_NOT_FOUND code and include the configPath plus the explicit
flag (use resolved.configPath and resolved.explicitConfigFile) so callers can
inspect { configPath, explicit } like loadProjectConfig() does; locate the logic
around resolveProjectConfigPaths, loadedProjectConfigPaths and the file.exists()
check and swap the Error for a StructuredError with the same message and the
extra metadata.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 140044ab-fe8f-4d3f-b63b-6d1cbbf6b256
📒 Files selected for processing (3)
packages/cli/src/cli.tspackages/cli/src/config.tspackages/cli/test/config/project-config-paths.test.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). (15)
- GitHub Check: Queue SDK Tests
- GitHub Check: Build
- GitHub Check: Template Integration Tests
- GitHub Check: Sandbox CLI Tests
- GitHub Check: Playwright E2E Smoke Test
- GitHub Check: Queue CLI Tests
- GitHub Check: SDK Integration Test Suite
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Framework Integration Tests (TanStack & Next.js)
- GitHub Check: Cloud Deployment Tests
- GitHub Check: Standalone Agent Test
- GitHub Check: Package Installation & Usage Test
- GitHub Check: Storage CLI Tests
- GitHub Check: Pack & Upload
- GitHub Check: Windows WSL CLI Smoke Test
🧰 Additional context used
📓 Path-based instructions (4)
packages/cli/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Use
Bun.file(f).exists()instead ofexistsSync(f)for file existence checks
Files:
packages/cli/test/config/project-config-paths.test.tspackages/cli/src/cli.tspackages/cli/src/config.ts
**/*.{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/cli/test/config/project-config-paths.test.tspackages/cli/src/cli.tspackages/cli/src/config.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/cli/test/config/project-config-paths.test.tspackages/cli/src/cli.tspackages/cli/src/config.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/cli/test/config/project-config-paths.test.ts
🧠 Learnings (3)
📚 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/cli/test/config/project-config-paths.test.tspackages/cli/src/cli.tspackages/cli/src/config.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/cli/test/config/project-config-paths.test.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.
Applied to files:
packages/cli/src/cli.tspackages/cli/src/config.ts
Summary
--dirvalues to point directly at an explicit JSON project configctx.projectDirrooted at the parent folder for explicit config files.jsondirectoriesFixes #1434
Verification
bun test packages/cli/test/config/project-config-paths.test.tsbunx biome lint packages/cli/src/config.ts packages/cli/src/cli.ts packages/cli/test/config/project-config-paths.test.tsbun run --filter='./packages/cli' typecheckbun run --filter='./packages/cli' buildSummary by CodeRabbit
Bug Fixes
Tests