fix(cli): friendly error when project name is missing from 'agents project create' #2253

Open
opened 2026-04-03 11:19:16 +00:00 by hamza.khyari · 1 comment
Member

Metadata

  • Commit Message: fix(cli): show friendly error when project name is missing
  • Branch: bugfix/project-create-missing-name
  • Type: Bug
  • Priority: Medium
  • MoSCoW: Should have
  • Points: 2
  • Milestone: v3.6.0

Bug Report

Steps to Reproduce

agents project create -d "my first test with agents"

Actual Behavior

Wrapping unexpected exception: MissingParameter: Missing parameter: name
Error [500] INTERNAL: An unexpected error occurred

The user sees a raw internal exception with a 500 error code. No indication of what they did wrong or how to fix it.

Expected Behavior

Error: Missing required argument 'NAME'.

Usage: agents project create NAME [OPTIONS]

  Create a new project.

Example:
  agents project create local/my-project -d "My first project"

A clear, actionable error message that tells the user:

  1. What's missing (the project name)
  2. The correct usage syntax
  3. An example of the correct command

Root Cause

The project create CLI command does not validate that the positional name argument is provided before passing it to the service layer. The service raises MissingParameter which bubbles up as an unhandled 500 error through the global exception wrapper.

Acceptance Criteria

  • agents project create -d "desc" (missing name) shows a friendly error, not a 500
  • Error message includes the correct usage syntax
  • Error exits with code 1 (not 500)
  • agents project create local/my-project -d "desc" still works correctly
  • No regression in existing project create tests

Subtasks

  • Add name validation in the CLI command before calling the service
  • Return user-friendly error message with usage hint
  • Tests (Behave): Add scenario for missing name
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `fix(cli): show friendly error when project name is missing` - **Branch**: `bugfix/project-create-missing-name` - **Type**: Bug - **Priority**: Medium - **MoSCoW**: Should have - **Points**: 2 - **Milestone**: v3.6.0 ## Bug Report ### Steps to Reproduce ```bash agents project create -d "my first test with agents" ``` ### Actual Behavior ``` Wrapping unexpected exception: MissingParameter: Missing parameter: name Error [500] INTERNAL: An unexpected error occurred ``` The user sees a raw internal exception with a 500 error code. No indication of what they did wrong or how to fix it. ### Expected Behavior ``` Error: Missing required argument 'NAME'. Usage: agents project create NAME [OPTIONS] Create a new project. Example: agents project create local/my-project -d "My first project" ``` A clear, actionable error message that tells the user: 1. What's missing (the project name) 2. The correct usage syntax 3. An example of the correct command ## Root Cause The `project create` CLI command does not validate that the positional `name` argument is provided before passing it to the service layer. The service raises `MissingParameter` which bubbles up as an unhandled 500 error through the global exception wrapper. ## Acceptance Criteria - [ ] `agents project create -d "desc"` (missing name) shows a friendly error, not a 500 - [ ] Error message includes the correct usage syntax - [ ] Error exits with code 1 (not 500) - [ ] `agents project create local/my-project -d "desc"` still works correctly - [ ] No regression in existing project create tests ## Subtasks - [ ] Add name validation in the CLI command before calling the service - [ ] Return user-friendly error message with usage hint - [ ] Tests (Behave): Add scenario for missing name - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
hamza.khyari added this to the v3.6.0 milestone 2026-04-03 11:19:16 +00:00
Owner

Issue reviewed and acknowledged.

Clear and well-structured bug report. The reproduction steps are minimal and the root cause is well-identified — the CLI command does not validate the positional name argument before passing it to the service layer, resulting in an unhandled MissingParameter exception surfacing as a confusing 500 error.

Triage summary:

  • State: Verified (confirmed — easily reproducible with clear expected behavior)
  • Priority: Medium (confirmed — poor UX but not a crash or data loss)
  • Milestone: v3.6.0 (already assigned — correct, this is a CLI usability fix)
  • MoSCoW: Should Have (already labeled)
  • Parent Epic: Not linked. This should be linked to a CLI error handling or CLI usability epic. Flagging as needing a parent epic link.

The issue is well-formed and ready for implementation. All required CONTRIBUTING.md sections are present.


Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: ca-human-liaison

Issue reviewed and acknowledged. Clear and well-structured bug report. The reproduction steps are minimal and the root cause is well-identified — the CLI command does not validate the positional `name` argument before passing it to the service layer, resulting in an unhandled `MissingParameter` exception surfacing as a confusing 500 error. **Triage summary:** - **State**: Verified (confirmed — easily reproducible with clear expected behavior) - **Priority**: Medium (confirmed — poor UX but not a crash or data loss) - **Milestone**: v3.6.0 (already assigned — correct, this is a CLI usability fix) - **MoSCoW**: Should Have (already labeled) - **Parent Epic**: Not linked. This should be linked to a CLI error handling or CLI usability epic. Flagging as needing a parent epic link. The issue is well-formed and ready for implementation. All required CONTRIBUTING.md sections are present. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: ca-human-liaison
freemo removed this from the v3.6.0 milestone 2026-04-07 01:13:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2253
No description provided.