feat(cli): add task comment management commands#1363
feat(cli): add task comment management commands#1363devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
Add create, get, update, delete, and list subcommands for task comments under 'cloud task comment'. Uses existing TaskStorageService comment APIs. Supports: - create: Add a comment to a task (with optional author override) - get: Get a comment by ID - update: Update a comment body - delete: Delete a comment - list: List comments on a task (with pagination) Co-Authored-By: Rick Blalock <rickblalock@mac.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
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 (1)
✅ Files skipped from review due to trivial 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)
📝 WalkthroughWalkthroughAdds a new Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-schema-2.0.9-7176fe9.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-db-2.0.9-7176fe9.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-auth-2.0.9-7176fe9.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-react-2.0.9-7176fe9.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-email-2.0.9-7176fe9.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-vector-2.0.9-7176fe9.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-schedule-2.0.9-7176fe9.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-keyvalue-2.0.9-7176fe9.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-runtime-2.0.9-7176fe9.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-migrate-2.0.9-7176fe9.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-workbench-2.0.9-7176fe9.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-claude-code-2.0.9-7176fe9.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-drizzle-2.0.9-7176fe9.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-evals-2.0.9-7176fe9.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-queue-2.0.9-7176fe9.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-coder-tui-2.0.9-7176fe9.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-frontend-2.0.9-7176fe9.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-core-2.0.9-7176fe9.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-coder-2.0.9-7176fe9.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-opencode-2.0.9-7176fe9.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-sandbox-2.0.9-7176fe9.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-postgres-2.0.9-7176fe9.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-server-2.0.9-7176fe9.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-cli-2.0.9-7176fe9.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-webhook-2.0.9-7176fe9.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-task-2.0.9-7176fe9.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-schema-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-db-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-auth-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-react-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-email-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-vector-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-schedule-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-keyvalue-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-runtime-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-migrate-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-workbench-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-claude-code-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-drizzle-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-evals-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-queue-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-coder-tui-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-frontend-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-core-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-coder-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-opencode-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-sandbox-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-postgres-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-server-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-cli-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-webhook-2.0.9-7176fe9.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-7176fe9/agentuity-task-2.0.9-7176fe9.tgz |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/cli/src/cmd/cloud/task/comment.ts (1)
98-110: UseisJSONMode(options)instead of!options.jsonfor consistency with the framework's output gating pattern.The codebase defines a standard
isJSONMode()helper inpackages/cli/src/output.tsthat checksoptions.json === true, and other CLI commands consistently use it (e.g.,upgrade/index.ts,project/hostname/get.ts,ai/opencode/dashboard.ts). This file should use the same helper for consistency across the codebase.Applies to lines 98, 175, 245, 305, and 379.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/src/cmd/cloud/task/comment.ts` around lines 98 - 110, Replace direct checks of options.json with the shared helper: change occurrences like if (!options.json) to if (!isJSONMode(options)) so the command uses the standard output gating; update each block that currently guards interactive output (the ones calling tui.success, tui.table, etc. around comment.id, comment.task_id, comment.body, comment.author, comment.created_at) to use !isJSONMode(options) instead of !options.json to match the framework pattern.
🤖 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/cli/src/cmd/cloud/task/comment.ts`:
- Around line 421-456: Move the exported commentSubcommand (and its associated
subcommand symbols createCommentSubcommand, getCommentSubcommand,
updateCommentSubcommand, deleteCommentSubcommand, listCommentsSubcommand) out of
the flat comment.ts file and make that file the directory entrypoint by placing
the same export in a new index.ts inside a comment directory; ensure index.ts
re-exports or imports the existing subcommand implementations and preserves the
createCommand call, name, aliases, description, tags, requires, examples and
subcommands array so the CLI layout follows the established command-as-directory
structure.
- Around line 367-375: The handler currently calls createStorageAdapter(ctx)
which hard-fails when no org is configured; swap it to use
createStorageAdapterOptionalOrg(ctx) in the same handler so the read-only
listComments call doesn't exit early. Update the storage acquisition in the
handler that calls storage.listComments(args.taskId, { limit: opts.limit,
offset: opts.offset }) to use createStorageAdapterOptionalOrg instead of
createStorageAdapter, keeping the rest of the logic unchanged.
---
Nitpick comments:
In `@packages/cli/src/cmd/cloud/task/comment.ts`:
- Around line 98-110: Replace direct checks of options.json with the shared
helper: change occurrences like if (!options.json) to if (!isJSONMode(options))
so the command uses the standard output gating; update each block that currently
guards interactive output (the ones calling tui.success, tui.table, etc. around
comment.id, comment.task_id, comment.body, comment.author, comment.created_at)
to use !isJSONMode(options) instead of !options.json to match the framework
pattern.
🪄 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: f90930e4-aea1-46b8-bd8d-fd49451fd3bb
📒 Files selected for processing (2)
packages/cli/src/cmd/cloud/task/comment.tspackages/cli/src/cmd/cloud/task/index.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 CLI Tests
- GitHub Check: Playwright E2E Smoke Test
- GitHub Check: Queue SDK Tests
- GitHub Check: Sandbox CLI Tests
- GitHub Check: Storage CLI Tests
- GitHub Check: Framework Integration Tests (TanStack & Next.js)
- GitHub Check: Cloud Deployment Tests
- GitHub Check: Template Integration Tests
- GitHub Check: Standalone Agent Test
- GitHub Check: Package Installation & Usage Test
- GitHub Check: SDK Integration Test Suite
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: Build
- GitHub Check: Pack & Upload
🧰 Additional context used
📓 Path-based instructions (5)
packages/cli/src/cmd/**/index.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/cmd/**/index.ts: Each command must be structured as a directory insrc/cmd/with anindex.tsfile as the entry point
Always define interfaces or Zod schemas for command options; never useanytype for type safety
Usetui.*helpers (header, info, success, warning, error, table, progress) for formatted TUI output instead of raw console methods
Usectx.loggerfor logging instead of console methods; uselogger.fatal()for fatal errors which logs and exits with code 1
Always checkisJSONMode()before outputting data and provide machine-readable output when in JSON mode
UserequireAuth(ctx)for commands that require authentication oroptionalAuth(ctx)for commands that support optional authentication
Files:
packages/cli/src/cmd/cloud/task/index.ts
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/src/cmd/cloud/task/index.tspackages/cli/src/cmd/cloud/task/comment.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/src/cmd/cloud/task/index.tspackages/cli/src/cmd/cloud/task/comment.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/src/cmd/cloud/task/index.tspackages/cli/src/cmd/cloud/task/comment.ts
**/index.ts
📄 CodeRabbit inference engine (AGENTS.md)
Use named exports from package
index.tsfiles
Files:
packages/cli/src/cmd/cloud/task/index.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/src/cmd/cloud/task/index.tspackages/cli/src/cmd/cloud/task/comment.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/task/index.tspackages/cli/src/cmd/cloud/task/comment.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/cmd/cloud/task/index.tspackages/cli/src/cmd/cloud/task/comment.ts
| export const commentSubcommand = createCommand({ | ||
| name: 'comment', | ||
| aliases: ['comments', 'cmt'], | ||
| description: 'Manage task comments', | ||
| tags: ['requires-auth'], | ||
| requires: { auth: true }, | ||
| examples: [ | ||
| { | ||
| command: getCommand('cloud task comment create task_abc123 "Looks good"'), | ||
| description: 'Add a comment to a task', | ||
| }, | ||
| { | ||
| command: getCommand('cloud task comment list task_abc123'), | ||
| description: 'List comments on a task', | ||
| }, | ||
| { | ||
| command: getCommand('cloud task comment get cmt_abc123'), | ||
| description: 'Get a comment by ID', | ||
| }, | ||
| { | ||
| command: getCommand('cloud task comment update cmt_abc123 "Updated text"'), | ||
| description: 'Update a comment', | ||
| }, | ||
| { | ||
| command: getCommand('cloud task comment delete cmt_abc123'), | ||
| description: 'Delete a comment', | ||
| }, | ||
| ], | ||
| subcommands: [ | ||
| createCommentSubcommand, | ||
| getCommentSubcommand, | ||
| updateCommentSubcommand, | ||
| deleteCommentSubcommand, | ||
| listCommentsSubcommand, | ||
| ], | ||
| }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Place this command group under comment/index.ts.
This new CLI command is introduced as a flat comment.ts file, but command groups in src/cmd/ are supposed to live in their own directory entrypoint. Moving this to packages/cli/src/cmd/cloud/task/comment/index.ts keeps the command layout consistent with the rest of the tree.
As per coding guidelines, "Each command must be structured as a directory in src/cmd/ with an index.ts file as the entry point".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/cli/src/cmd/cloud/task/comment.ts` around lines 421 - 456, Move the
exported commentSubcommand (and its associated subcommand symbols
createCommentSubcommand, getCommentSubcommand, updateCommentSubcommand,
deleteCommentSubcommand, listCommentsSubcommand) out of the flat comment.ts file
and make that file the directory entrypoint by placing the same export in a new
index.ts inside a comment directory; ensure index.ts re-exports or imports the
existing subcommand implementations and preserves the createCommand call, name,
aliases, description, tags, requires, examples and subcommands array so the CLI
layout follows the established command-as-directory structure.
Co-Authored-By: Rick Blalock <rickblalock@mac.com>
Summary
Adds a new
cloud task commentcommand group to the CLI with full CRUD support for task comments. The backend APIs and web app already support comments, but the CLI was missing this functionality.New subcommands:
create— Add a comment to a task (supports optional--user-id,--user-name,--user-typefor author override)get— Retrieve a single comment by IDupdate— Edit a comment's body textdelete— Remove a commentlist— List comments on a task with--limit/--offsetpaginationAll commands delegate to existing
TaskStorageServicemethods from@agentuity/core. The implementation follows the same patterns as the existingattachment.tssubcommand group (parent command with subcommands, Zod schemas, TUI table output,--jsonsupport).Review & Testing Checklist for Human
authorEntityRef compatibility increateComment: The create handler constructs anauthorobject{ id, name, type? }and passes it tostorage.createComment(). Confirm this matches theEntityReftype the service expects — a mismatch would fail at runtime but not at compile time since the parameter is typed loosely.createcommand author resolution path: The handler resolves the current user's name via cached info orwhoami()fallback. If both fail, it passesundefinedfor author. Verify this produces correct results with the API.create,get,update,list,delete) against real tasks to confirm the API calls work and output renders correctly.Notes
bun allfails in CI due to a pre-existingintegration-suiteBun version requirement (needs >=1.3.3, environment has 1.3.1). The CLI package itself builds and typechecks cleanly (bun run --filter='./packages/cli' buildandbunx tsc --buildboth pass).getcommand usescreateStorageAdapterOptionalOrg(matching the pattern in other read-only-by-ID commands), while mutating commands usecreateStorageAdapter.Link to Devin session: https://app.devin.ai/sessions/049f4834582f4ee7a108385ef64fdd20
Summary by CodeRabbit
cloud task commentCLI with subcommands to create, get, update, delete, and list task comments.