-
Notifications
You must be signed in to change notification settings - Fork 1
task/org id not respecting preference #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughMultiple utility functions updated to include Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
6c48d63 to
d1989c8
Compare
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-evals-0.1.21-d1989c8.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-react-0.1.21-d1989c8.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-workbench-0.1.21-d1989c8.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-schema-0.1.21-d1989c8.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-runtime-0.1.21-d1989c8.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-auth-0.1.21-d1989c8.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-server-0.1.21-d1989c8.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-frontend-0.1.21-d1989c8.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-opencode-0.1.21-d1989c8.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-cli-0.1.21-d1989c8.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-core-0.1.21-d1989c8.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-evals-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-react-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-workbench-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-schema-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-runtime-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-auth-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-server-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-frontend-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-opencode-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-cli-0.1.21-d1989c8.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.21-d1989c8/agentuity-core-0.1.21-d1989c8.tgzCLI Executables
Run Canary CLIagentuity canary 0.1.21-d1989c8 [command] [...args] |
There was a problem hiding this 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
🤖 Fix all issues with AI agents
In `@packages/cli/src/cmd/cloud/keyvalue/util.ts`:
- Around line 14-17: The orgId precedence currently assigns ctx.project?.orgId
before environment or saved preferences; change the evaluation order for the
orgId constant so environment (process.env.AGENTUITY_CLOUD_ORG_ID) and config
preferences (ctx.config?.preferences?.orgId) and explicit CLI options
(ctx.options.orgId) are checked before falling back to ctx.project?.orgId;
update the orgId expression (the orgId constant in util.ts) to reorder the
nullish/coalescing checks so env and preferences take precedence over
project.orgId.
In `@packages/cli/src/cmd/cloud/vector/util.ts`:
- Around line 14-17: The orgId precedence currently uses ctx.project?.orgId
first; change the selection logic so the CLI flag (ctx.options.orgId) is checked
first, then environment and preferences (process.env.AGENTUITY_CLOUD_ORG_ID or
ctx.config?.preferences?.orgId), and finally fall back to the project value
(ctx.project?.orgId). Update the expression that sets orgId to reflect this
order and ensure all referenced symbols (ctx.options.orgId,
process.env.AGENTUITY_CLOUD_ORG_ID, ctx.config?.preferences?.orgId,
ctx.project?.orgId) are evaluated in that new precedence.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/cli/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
🧰 Additional context used
📓 Path-based instructions (3)
packages/cli/src/cmd/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/cmd/**/*.ts: Usetui.*helpers for formatted output instead of raw console logs
Usectx.loggerfor logging; calllogger.fatal()to log and exit with code 1
Files:
packages/cli/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
packages/cli/src/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Use
Bun.file(f).exists()instead ofexistsSync(f)for file existence checks
Files:
packages/cli/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use Prettier formatter with tabs (width 3), single quotes, and semicolons for TypeScript files
Use TypeScript strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/cli/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
🧠 Learnings (2)
📚 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/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
📚 Learning: 2026-01-13T04:32:02.691Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 565
File: packages/cli/src/cmd/cloud/region-lookup.ts:14-26
Timestamp: 2026-01-13T04:32:02.691Z
Learning: Enforce sandbox identifier prefixes in new code within the CLI cloud region lookup: new sandboxes must use the sbx_ prefix. The snbx_ prefix may appear in legacy code or examples, but do not use snbx_ for new sandboxes. When reviewing changes in packages/cli/src/cmd/cloud/, ensure any created sandbox identifiers use sbx_ and remove or migrate any snbx_ usages in newly added code.
Applied to files:
packages/cli/src/cmd/cloud/keyvalue/util.tspackages/cli/src/cmd/cloud/vector/util.ts
🧬 Code graph analysis (2)
packages/cli/src/cmd/cloud/keyvalue/util.ts (2)
packages/cli/src/cmd/cloud/vector/util.ts (1)
createStorageAdapter(6-37)packages/cli/src/types.ts (5)
Logger(12-12)AuthData(275-279)ProjectConfig(321-321)Config(67-67)GlobalOptions(281-296)
packages/cli/src/cmd/cloud/vector/util.ts (2)
packages/cli/src/cmd/cloud/keyvalue/util.ts (1)
createStorageAdapter(6-37)packages/cli/src/types.ts (5)
Logger(12-12)AuthData(275-279)ProjectConfig(321-321)Config(67-67)GlobalOptions(281-296)
⏰ 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). (6)
- GitHub Check: Build
- GitHub Check: Playwright E2E Smoke Test
- GitHub Check: Sandbox CLI Tests
- GitHub Check: Framework Integration Tests (TanStack & Next.js)
- GitHub Check: Cloud Deployment Tests
- GitHub Check: SDK Integration Test Suite
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| const orgId = | ||
| ctx.project?.orgId ?? | ||
| ctx.options.orgId ?? | ||
| (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Org ID precedence still ignores env/preferences when a project orgId exists.
Same issue as in vector util: project.orgId currently overrides env/preferences. If env or preference should always be respected, move them ahead of project.
🔧 Proposed fix
-const orgId =
- ctx.project?.orgId ??
- ctx.options.orgId ??
- (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
+const orgId =
+ ctx.options.orgId ??
+ process.env.AGENTUITY_CLOUD_ORG_ID ??
+ ctx.config?.preferences?.orgId ??
+ ctx.project?.orgId;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const orgId = | |
| ctx.project?.orgId ?? | |
| ctx.options.orgId ?? | |
| (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId); | |
| const orgId = | |
| ctx.options.orgId ?? | |
| process.env.AGENTUITY_CLOUD_ORG_ID ?? | |
| ctx.config?.preferences?.orgId ?? | |
| ctx.project?.orgId; |
🤖 Prompt for AI Agents
In `@packages/cli/src/cmd/cloud/keyvalue/util.ts` around lines 14 - 17, The orgId
precedence currently assigns ctx.project?.orgId before environment or saved
preferences; change the evaluation order for the orgId constant so environment
(process.env.AGENTUITY_CLOUD_ORG_ID) and config preferences
(ctx.config?.preferences?.orgId) and explicit CLI options (ctx.options.orgId)
are checked before falling back to ctx.project?.orgId; update the orgId
expression (the orgId constant in util.ts) to reorder the nullish/coalescing
checks so env and preferences take precedence over project.orgId.
| const orgId = | ||
| ctx.project?.orgId ?? | ||
| ctx.options.orgId ?? | ||
| (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Org ID precedence still ignores env/preferences when a project orgId exists.
The current order prefers project.orgId over env/preferences, which can override the “always respect env and preferences” objective when running inside a project. Consider prioritizing CLI flag, then env/preferences, then project.
🔧 Proposed fix
-const orgId =
- ctx.project?.orgId ??
- ctx.options.orgId ??
- (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
+const orgId =
+ ctx.options.orgId ??
+ process.env.AGENTUITY_CLOUD_ORG_ID ??
+ ctx.config?.preferences?.orgId ??
+ ctx.project?.orgId;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const orgId = | |
| ctx.project?.orgId ?? | |
| ctx.options.orgId ?? | |
| (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId); | |
| const orgId = | |
| ctx.options.orgId ?? | |
| process.env.AGENTUITY_CLOUD_ORG_ID ?? | |
| ctx.config?.preferences?.orgId ?? | |
| ctx.project?.orgId; |
🤖 Prompt for AI Agents
In `@packages/cli/src/cmd/cloud/vector/util.ts` around lines 14 - 17, The orgId
precedence currently uses ctx.project?.orgId first; change the selection logic
so the CLI flag (ctx.options.orgId) is checked first, then environment and
preferences (process.env.AGENTUITY_CLOUD_ORG_ID or
ctx.config?.preferences?.orgId), and finally fall back to the project value
(ctx.project?.orgId). Update the expression that sets orgId to reflect this
order and ensure all referenced symbols (ctx.options.orgId,
process.env.AGENTUITY_CLOUD_ORG_ID, ctx.config?.preferences?.orgId,
ctx.project?.orgId) are evaluated in that new precedence.
org id should always respect the env and preferences
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.