UAT: agents server connect missing --token parameter — cannot set server.token authentication credential via connect command #3547

Closed
opened 2026-04-05 19:14:58 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/server-connect-missing-token-param
  • Commit Message: fix(cli): add --token parameter to agents server connect command
  • Milestone: None (Backlog)
  • Parent Epic: #399

Summary

The agents server connect command in src/cleveragents/cli/commands/server.py accepts --namespace and --tls-verify options but has no --token parameter for setting the authentication token (server.token). The spec defines server.token as a required configuration key for server mode authentication, and the connect command is the natural place to set it.

Expected Behavior (from spec)

Per spec §Server Configuration and Connection:

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 agents server connect command should accept a --token option that sets server.token in the config, alongside the server URL. This is the natural UX for connecting to a server — the user provides both the URL and the token in a single command.

Additionally, the ServerConnectionConfig model in src/cleveragents/a2a/server_config.py has an auth_token_ref field but the server connect command never sets it.

Actual Behavior

agents server connect signature:

agents server connect <SERVER_URL> [--namespace <NS>] [--tls-verify/--no-tls-verify] [--format <FMT>]

No --token option. Users must run a separate command to set the token:

agents config set server.token "tok_01HXR..."

This is a poor UX and inconsistent with the spec's framing of server.url and server.token as a pair of required keys for server connection.

The server connect command also saves server.namespace and server.tls-verify to config but does NOT save server.token, even though ServerConnectionConfig.auth_token_ref exists for this purpose.

Code Location

  • src/cleveragents/cli/commands/server.pyserver_connect() function — missing --token parameter
  • src/cleveragents/a2a/server_config.pyServerConnectionConfig.auth_token_ref field exists but is never set by the CLI

Spec References

  • spec §Server Configuration and Connection: "Connecting to a server requires two configuration keys: server.url and server.token"
  • spec §Authentication: "Client authenticates using the declared scheme — typically Authorization: Bearer <server.token> header"
  • spec §Config Keys: server.token"Authentication token for server mode. Required when server.url is set."

Subtasks

  • Add --token Click option to server_connect() in src/cleveragents/cli/commands/server.py
  • Wire --token value to persist server.token in the user config (alongside server.url, server.namespace, server.tls-verify)
  • Wire --token value to populate ServerConnectionConfig.auth_token_ref in src/cleveragents/a2a/server_config.py
  • Tests (Behave): Add BDD scenario — agents server connect <URL> --token <TOK> sets server.token in config
  • Tests (Behave): Add BDD scenario — ServerConnectionConfig.auth_token_ref is populated when token is provided
  • Tests (Robot): Add integration test for agents server connect with --token parameter
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

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 (fix(cli): add --token parameter to agents server connect command), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/server-connect-missing-token-param).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.8.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


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

## Metadata - **Branch**: `fix/server-connect-missing-token-param` - **Commit Message**: `fix(cli): add --token parameter to agents server connect command` - **Milestone**: None (Backlog) - **Parent Epic**: #399 ## Summary The `agents server connect` command in `src/cleveragents/cli/commands/server.py` accepts `--namespace` and `--tls-verify` options but has no `--token` parameter for setting the authentication token (`server.token`). The spec defines `server.token` as a required configuration key for server mode authentication, and the connect command is the natural place to set it. ## Expected Behavior (from spec) Per spec §Server Configuration and Connection: > 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 `agents server connect` command should accept a `--token` option that sets `server.token` in the config, alongside the server URL. This is the natural UX for connecting to a server — the user provides both the URL and the token in a single command. Additionally, the `ServerConnectionConfig` model in `src/cleveragents/a2a/server_config.py` has an `auth_token_ref` field but the `server connect` command never sets it. ## Actual Behavior `agents server connect` signature: ``` agents server connect <SERVER_URL> [--namespace <NS>] [--tls-verify/--no-tls-verify] [--format <FMT>] ``` No `--token` option. Users must run a separate command to set the token: ``` agents config set server.token "tok_01HXR..." ``` This is a poor UX and inconsistent with the spec's framing of `server.url` and `server.token` as a pair of required keys for server connection. The `server connect` command also saves `server.namespace` and `server.tls-verify` to config but does NOT save `server.token`, even though `ServerConnectionConfig.auth_token_ref` exists for this purpose. ## Code Location - `src/cleveragents/cli/commands/server.py` — `server_connect()` function — missing `--token` parameter - `src/cleveragents/a2a/server_config.py` — `ServerConnectionConfig.auth_token_ref` field exists but is never set by the CLI ## Spec References - spec §Server Configuration and Connection: *"Connecting to a server requires two configuration keys: `server.url` and `server.token`"* - spec §Authentication: *"Client authenticates using the declared scheme — typically `Authorization: Bearer <server.token>` header"* - spec §Config Keys: `server.token` — *"Authentication token for server mode. Required when `server.url` is set."* ## Subtasks - [ ] Add `--token` Click option to `server_connect()` in `src/cleveragents/cli/commands/server.py` - [ ] Wire `--token` value to persist `server.token` in the user config (alongside `server.url`, `server.namespace`, `server.tls-verify`) - [ ] Wire `--token` value to populate `ServerConnectionConfig.auth_token_ref` in `src/cleveragents/a2a/server_config.py` - [ ] Tests (Behave): Add BDD scenario — `agents server connect <URL> --token <TOK>` sets `server.token` in config - [ ] Tests (Behave): Add BDD scenario — `ServerConnectionConfig.auth_token_ref` is populated when token is provided - [ ] Tests (Robot): Add integration test for `agents server connect` with `--token` parameter - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## 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 (`fix(cli): add --token parameter to agents server connect command`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/server-connect-missing-token-param`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.8.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — The spec defines server.token as a required configuration key, but users can work around this via agents config set server.token. The missing --token flag is a UX gap, not a functional blocker.
  • Milestone: v3.8.0 — Server CLI improvements belong to the Post-MVP Server milestone.
  • Story Points: 2 — S — Adding a Click option, wiring it to config persistence, and writing tests. Straightforward implementation following existing patterns.
  • MoSCoW: Should Have — The spec frames server.url and server.token as a pair of required keys for connection. The connect command should set both. Important for UX consistency but not blocking.
  • Parent Epic: #399 (Post-MVP Server & Clients)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — The spec defines `server.token` as a required configuration key, but users can work around this via `agents config set server.token`. The missing `--token` flag is a UX gap, not a functional blocker. - **Milestone**: v3.8.0 — Server CLI improvements belong to the Post-MVP Server milestone. - **Story Points**: 2 — S — Adding a Click option, wiring it to config persistence, and writing tests. Straightforward implementation following existing patterns. - **MoSCoW**: Should Have — The spec frames `server.url` and `server.token` as a pair of required keys for connection. The connect command should set both. Important for UX consistency but not blocking. - **Parent Epic**: #399 (Post-MVP Server & Clients) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.8.0 milestone 2026-04-05 19:35:04 +00:00
Author
Owner

Closing as duplicate of #2153.

Both issues describe the same bug: agents server connect is missing the --token parameter for setting server.token. Issue #2153 is the established tracking issue (v3.7.0 milestone, Priority/High, State/Verified). See also #2562 which covers the same issue. Please track this work in #2153.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Closing as duplicate of #2153. Both issues describe the same bug: `agents server connect` is missing the `--token` parameter for setting `server.token`. Issue #2153 is the established tracking issue (v3.7.0 milestone, `Priority/High`, `State/Verified`). See also #2562 which covers the same issue. Please track this work in #2153. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
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.

Blocks
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3547
No description provided.