Bug: agents server connect command missing --token option — spec requires server.token to be set during connection #2153

Open
opened 2026-04-03 04:29:39 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/cli-server-connect-missing-token-option
  • Commit Message: fix(cli): add --token option to agents server connect command
  • Milestone: v3.7.0
  • Parent Epic: #933

Description

The specification states that connecting to a server requires two configuration keys:

Key Env Var Purpose
server.url CLEVERAGENTS_SERVER_URL URL of the CleverAgents A2A server endpoint
server.token CLEVERAGENTS_SERVER_TOKEN Authentication token (obtained via server registration or team invite)

The A2A standard also requires:

"HTTP auth (OAuth2 / API key) | Client → Server | Token-based authentication (server.token) via auth schemes declared in Agent Card"

Expected behavior (per spec): The agents server connect command must accept a --token option that persists the authentication token to the server.token config key. Without a token, server mode authentication cannot work.

Actual behavior: The agents server connect command only accepts --namespace, --tls-verify/--no-tls-verify, and --format options. There is no --token option. The server.token config key is registered in the config service but is never set by the server connect command.

Code location: src/cleveragents/cli/commands/server.pyserver_connect() function (lines 100–175). The function calls svc.set_value("server.url", ...), svc.set_value("server.namespace", ...), and svc.set_value("server.tls-verify", ...) but never svc.set_value("server.token", ...).

Steps to reproduce:

agents server connect https://agents.example.com --token mytoken
# Error: No such option: --token

Severity: High — users cannot configure authentication for server mode via the CLI. The server.token config key can only be set via agents config set server.token <value> or the CLEVERAGENTS_SERVER_TOKEN environment variable, which is not the expected UX per the specification.

Subtasks

  • Write a failing Behave scenario in features/ that reproduces the missing --token option bug (TDD — must be merged before fix)
  • Add --token Click option to server_connect() in src/cleveragents/cli/commands/server.py
  • Call svc.set_value("server.token", token) inside server_connect() when --token is provided
  • Add type annotation for the new token parameter in server_connect() signature
  • Update Robot Framework integration test in robot/ to cover agents server connect --token
  • Update CLI help text / documentation to reflect the new --token option
  • Verify all nox sessions pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)

Definition of Done

  • A failing Behave test reproducing the bug exists and was merged prior to the fix
  • agents server connect <url> --token <token> correctly persists the token to server.token config key
  • agents server connect <url> without --token does not error and leaves server.token unchanged
  • All type annotations are explicit and pass nox -e typecheck (Pyright) with no suppressions
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/cli-server-connect-missing-token-option` - **Commit Message**: `fix(cli): add --token option to agents server connect command` - **Milestone**: v3.7.0 - **Parent Epic**: #933 ## Description The specification states that connecting to a server requires two configuration keys: | Key | Env Var | Purpose | |-----|---------|---------| | `server.url` | `CLEVERAGENTS_SERVER_URL` | URL of the CleverAgents A2A server endpoint | | `server.token` | `CLEVERAGENTS_SERVER_TOKEN` | Authentication token (obtained via server registration or team invite) | The A2A standard also requires: > "HTTP auth (OAuth2 / API key) | Client → Server | Token-based authentication (`server.token`) via auth schemes declared in Agent Card" **Expected behavior (per spec)**: The `agents server connect` command must accept a `--token` option that persists the authentication token to the `server.token` config key. Without a token, server mode authentication cannot work. **Actual behavior**: The `agents server connect` command only accepts `--namespace`, `--tls-verify/--no-tls-verify`, and `--format` options. There is no `--token` option. The `server.token` config key is registered in the config service but is never set by the `server connect` command. **Code location**: `src/cleveragents/cli/commands/server.py` — `server_connect()` function (lines 100–175). The function calls `svc.set_value("server.url", ...)`, `svc.set_value("server.namespace", ...)`, and `svc.set_value("server.tls-verify", ...)` but never `svc.set_value("server.token", ...)`. **Steps to reproduce**: ```bash agents server connect https://agents.example.com --token mytoken # Error: No such option: --token ``` **Severity**: High — users cannot configure authentication for server mode via the CLI. The `server.token` config key can only be set via `agents config set server.token <value>` or the `CLEVERAGENTS_SERVER_TOKEN` environment variable, which is not the expected UX per the specification. ## Subtasks - [ ] Write a failing Behave scenario in `features/` that reproduces the missing `--token` option bug (TDD — must be merged before fix) - [ ] Add `--token` Click option to `server_connect()` in `src/cleveragents/cli/commands/server.py` - [ ] Call `svc.set_value("server.token", token)` inside `server_connect()` when `--token` is provided - [ ] Add type annotation for the new `token` parameter in `server_connect()` signature - [ ] Update Robot Framework integration test in `robot/` to cover `agents server connect --token` - [ ] Update CLI help text / documentation to reflect the new `--token` option - [ ] Verify all nox sessions pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) ## Definition of Done - [ ] A failing Behave test reproducing the bug exists and was merged prior to the fix - [ ] `agents server connect <url> --token <token>` correctly persists the token to `server.token` config key - [ ] `agents server connect <url>` without `--token` does not error and leaves `server.token` unchanged - [ ] All type annotations are explicit and pass `nox -e typecheck` (Pyright) with no suppressions - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:29:44 +00:00
freemo self-assigned this 2026-04-03 16:58:00 +00:00
Author
Owner

MoSCoW classification: Must Have

Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

MoSCoW classification: **Must Have** Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo removed this from the v3.7.0 milestone 2026-04-07 01:19:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

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