Compare commits

..

5 Commits

Author SHA1 Message Date
HAL9000 7fec791d85 fix(cli): add agents project switch command to project CLI
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Failing after 40s
CI / lint (pull_request) Failing after 1m2s
CI / typecheck (pull_request) Successful in 1m17s
CI / quality (pull_request) Successful in 1m12s
CI / security (pull_request) Successful in 1m41s
CI / push-validation (pull_request) Successful in 26s
CI / build (pull_request) Successful in 33s
CI / helm (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m15s
CI / unit_tests (pull_request) Successful in 4m18s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Failing after 3m58s
CI / status-check (pull_request) Failing after 3s
Implements the agents project switch <name> command to switch the active
project context, bringing the CLI into compliance with the CleverAgents CLI
spec (v3.2.0+).

Changes:
- Added switch subcommand extracted to src/cleveragents/cli/commands/project_switch.py
  to keep project.py below the 500-line guideline
- Implemented project context switching via ProjectService.set_current_project()
  maintaining the CLI -> Service -> Repository 4-layer architecture boundary
- Added --format flag support (rich, json, yaml, plain) for output formatting
- Implemented appropriate error handling when the project does not exist
- Added BDD feature scenarios and step definitions for the new command
- Updated BDD scenarios to assert context change was persisted via service layer
- Updated CONTRIBUTORS.md with contribution details

Closes #8623

ISSUES CLOSED: #8623
2026-05-04 19:59:53 +00:00
HAL9000 6236d6fc4f ci: retrigger CI after infrastructure failure (attempt 2)
CI / benchmark-regression (push) Has been skipped
CI / push-validation (push) Successful in 32s
CI / helm (push) Successful in 51s
CI / build (push) Successful in 56s
CI / lint (push) Successful in 1m32s
CI / quality (push) Successful in 1m41s
CI / typecheck (push) Successful in 1m44s
CI / security (push) Successful in 1m44s
CI / e2e_tests (push) Successful in 3m44s
CI / integration_tests (push) Successful in 7m41s
CI / unit_tests (push) Successful in 8m57s
CI / coverage (push) Successful in 12m34s
CI / benchmark-publish (push) Successful in 1h17m33s
CI / docker (push) Failing after 1s
CI / status-check (push) Failing after 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Failing after 38s
CI / coverage (pull_request) Successful in 16m41s
CI / build (pull_request) Successful in 40s
CI / docker (pull_request) Successful in 1m31s
CI / typecheck (pull_request) Successful in 1m12s
CI / quality (pull_request) Successful in 1m25s
CI / integration_tests (pull_request) Successful in 3m23s
CI / e2e_tests (pull_request) Successful in 4m21s
CI / unit_tests (pull_request) Successful in 6m27s
CI / helm (pull_request) Successful in 33s
CI / push-validation (pull_request) Successful in 32s
CI / lint (pull_request) Successful in 52s
CI / security (pull_request) Successful in 1m54s
CI / status-check (pull_request) Successful in 3s
2026-05-03 23:11:39 +00:00
HAL9000 b509be5037 ci: retrigger CI for bugfix/m3 branch after infrastructure failure 2026-05-03 23:11:39 +00:00
HAL9000 87146b67b8 fix(test): update a2a SDK TDD test to use Client instead of A2AClient 2026-05-03 23:11:39 +00:00
HAL9000 a998c5a0bf fix(test): add root_plan_id to raw SQL in plan_phase_migration constraint tests
The step_try_insert_plan_with_phase_and_state function was using raw SQL to
insert a plan with an invalid phase value to test the CHECK constraint. However,
the raw SQL was missing the root_plan_id column, which is NOT NULL in the schema.
This caused the insert to fail with a NOT NULL violation instead of the intended
CHECK constraint violation on the phase column.

This fix adds root_plan_id to the raw SQL INSERT statement, setting it to the
same value as plan_id (for a root plan). This allows the test to properly
exercise the CHECK constraint on the phase column, ensuring the test fails for
the correct reason.

ISSUES CLOSED: #9411
2026-05-03 23:11:39 +00:00
+8 -3
View File
@@ -113,7 +113,11 @@ def step_insert_plan_with_phase_and_state(context: Any, phase: str, state: str)
def step_try_insert_plan_with_phase_and_state(
context: Any, phase: str, state: str
) -> None:
"""Try to insert a plan with the specified phase and state, expecting failure."""
"""Try inserting a plan without ORM defaults to exercise the phase constraint.
The direct SQL insert must provide both plan_id and root_plan_id so the
phase constraint is validated instead of failing on missing root_plan_id.
"""
session: Session = context.phase_rebaseline_session
ulid = _next_ulid()
now = _now_iso()
@@ -121,14 +125,15 @@ def step_try_insert_plan_with_phase_and_state(
session.execute(
text(
"INSERT INTO v3_plans "
"(plan_id, action_name, namespaced_name, namespace, "
"(plan_id, root_plan_id, action_name, namespaced_name, namespace, "
"phase, processing_state, description, tags_json, "
"created_at, updated_at) "
"VALUES (:pid, :aname, :nname, :ns, :phase, :state, "
"VALUES (:pid, :rpid, :aname, :nname, :ns, :phase, :state, "
":desc, :tags, :cat, :uat)"
),
{
"pid": ulid,
"rpid": ulid,
"aname": "local/phase-test-action",
"nname": "local/try-plan",
"ns": "local",