Skip to content

Unregistered agent returns NOT_FOUND instead of AGENT_NOT_AVAILABLE (§12) #84

@nficano

Description

@nficano

Category: spec-conformance Severity: minor
Location: crates/arcp-runtime/src/runtime/server.rs:859-871
Spec: ARCP v1.1 §12 (AGENT_NOT_AVAILABLE — "Requested agent is not registered.")

What

When the requested tool/agent is not registered the runtime emits job.failed with ErrorCode::NotFound. §12 defines a dedicated AGENT_NOT_AVAILABLE code for exactly this case (the version-mismatch sibling AGENT_VERSION_NOT_AVAILABLE is already implemented). Clients distinguishing "agent unknown" from generic not-found cannot.

Evidence

let Some(handler) = self.inner.tools.get(&agent_ref.name) else {
    let mut err = Envelope::new(MessageType::JobFailed(JobFailedPayload {
        code: ErrorCode::NotFound,
        retryable: Some(false),
        message: format!("tool not registered: {}", agent_ref.name),
        details: None,
    }));

Proposed fix

Add AgentNotAvailable to ErrorCode (rename "AGENT_NOT_AVAILABLE") and use it here.

Acceptance criteria

  • Invoking an unregistered agent yields wire code AGENT_NOT_AVAILABLE.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions