forked from cleveragents/cleveragents-core
3fe7dabb65
Implement RemoteProjectClient for accessing and executing projects hosted on a remote CleverAgents server: - Remote resource selection and server execution request wiring - Project-name resolution for remote namespaces and server aliases - Resolve project with fallback from custom to default namespace - Remote project caching with configurable TTL (default 5 min) - Explicit ResourceNotFoundError when remote project not found - Cache invalidation per-namespace or global - RemoteProject dataclass with project_id, name, namespace, alias, description - Behave scenarios (16 scenarios, 54 steps) - Robot Framework smoke tests - ASV benchmark for request overhead baseline - Reference documentation at docs/reference/server_remote_projects.md ISSUES CLOSED: #338
1.7 KiB
1.7 KiB
Remote Project Support
The RemoteProjectClient resolves and executes projects hosted on a
remote CleverAgents server. It provides namespace-aware project
resolution, execution request wiring, and a TTL-based project cache.
Project Resolution
Projects are resolved by name using the following fallback order:
- Exact match in the specified namespace
- Exact match in the
defaultnamespace ResourceNotFoundErrorwith an explanatory message
Server aliases are also supported — a project can be referenced by its alias rather than its full namespace-qualified name.
Remote Execution
from cleveragents.client.remote_project import RemoteProjectClient
client = RemoteProjectClient(http_client)
project = client.resolve_project("my-project", namespace="org")
result = client.request_execution(project.project_id)
Caching
Resolved projects are cached with a configurable TTL (default 5 minutes)
to minimize repeated server calls. Cache entries are keyed by
(name, namespace) tuples.
| Method | Description |
|---|---|
invalidate_cache() |
Clear all cached entries |
invalidate_cache(namespace="org") |
Clear cache for a specific namespace |
CLI Scaffolding
| Command | Description |
|---|---|
agents project list --remote |
List projects available on the server |
agents plan use --remote |
Create a plan targeting a remote project |
Both commands require a configured server connection (see HTTP client configuration).
Error Handling
| Exception | Cause |
|---|---|
ResourceNotFoundError |
Project not found on the server |
ServerConnectionError |
Server unreachable |
AuthorizationError |
User lacks access to the requested project or namespace |