You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ARCP v1.1 §12 adds three new error codes. PHP has LEASE_EXPIRED. Missing: BUDGET_EXHAUSTED (covered by cost.budget issue), AGENT_VERSION_NOT_AVAILABLE.
Add AGENT_VERSION_NOT_AVAILABLE to the error code enum and wire it into agent resolution. Document in errors guide.
src/Errors/ErrorPayload.php — confirm fromException() reads code()->value and details() for this exception.
src/Runtime/ARCPRuntime.php — confirm setDefaultToolVersion() and resolveTool() throw AgentVersionNotAvailableException (already implemented, lines ~155 and ~179).
src/Internal/Runtime/ToolInvocationHandler.php — verify it surfaces an uncaught AgentVersionNotAvailableException as a wire error. If not, wrap resolveTool() in try/catch (see ticket Implement agent versioning name@version #18, step 4) and emit ToolError(ErrorPayload::fromException($e)).
src/Internal/Client/ErrorMapper.php — confirm agentVersionNotAvailable() constructs the exception with $err->details['agent'] and $err->details['version'].
docs/guides/errors.md — existing. Add an entry for AGENT_VERSION_NOT_AVAILABLE with the wire shape.
tests/Unit/Errors/AgentVersionNotAvailableExceptionTest.php(new) — focused unit.
src/Errors/ErrorCode.php: open and confirm the enum case is present (line ~40) and defaultRetryable() does NOT include AgentVersionNotAvailable. The condition is a permanent failure for that version.
src/Runtime/ARCPRuntime.phpresolveTool(): confirm that when $ref->version !== null && !isset($bucket[$ref->version]) it throws new AgentVersionNotAvailableException($ref->name, $ref->version). Re-read line ~177-181.
src/Internal/Runtime/ToolInvocationHandler.phphandle(): wrap ($this->resolveTool)(AgentRef::parse($msg->tool)) so an AgentVersionNotAvailableException becomes a wire ToolError. Suggested patch:
Confirm ErrorPayload::fromException() already serializes details and retryable. If not, fix it (src/Errors/ErrorPayload.php).
src/Internal/Client/ErrorMapper.phpagentVersionNotAvailable(): confirm it reads $err->details['agent'] and $err->details['version'], falling back to '?' when missing or wrong type.
docs/guides/errors.md: append a section under "v1.1 additions":
AGENT_VERSION_NOT_AVAILABLE
- Raised when: caller invokes `name@version` and `version` is not registered on the runtime.
- Wire details: `{agent: string, version: string}`.
- Typed exception: `Arcp\Errors\AgentVersionNotAvailableException`.
- Retryable: false (a different version must be requested).
Assert client raises AgentVersionNotAvailableException with $e->details()['agent'] === 'planner', version === '9.9.9', and that the underlying wire ToolError had code === 'AGENT_VERSION_NOT_AVAILABLE'.
CONFORMANCE.md: add a row for AGENT_VERSION_NOT_AVAILABLE under v1.1 error codes (claim it once tests are green).
ARCP v1.1 §12 adds three new error codes. PHP has
LEASE_EXPIRED. Missing:BUDGET_EXHAUSTED(covered by cost.budget issue),AGENT_VERSION_NOT_AVAILABLE.Add
AGENT_VERSION_NOT_AVAILABLEto the error code enum and wire it into agent resolution. Document in errors guide.Audit reference: ARCP SDK Audit v1.1 (2026-05-19)
Implementation prompt
Code is landed; this is a "verify + document + add tests" pass. PSR-4 root:
Arcp\->src/. Tests:Arcp\Tests\->tests/. Spec ref:spec/docs/draft-arcp-1.1.md§12, §7.5.Files to touch
src/Errors/ErrorCode.php— confirmAgentVersionNotAvailable = 'AGENT_VERSION_NOT_AVAILABLE'enum case. ConfirmdefaultRetryable()returnsfalsefor it (not in retryable set).src/Errors/AgentVersionNotAvailableException.php— existing. Verify only.src/Errors/ARCPException.php— confirmdetails()round-trips{agent, version}.src/Errors/ErrorPayload.php— confirmfromException()readscode()->valueanddetails()for this exception.src/Runtime/ARCPRuntime.php— confirmsetDefaultToolVersion()andresolveTool()throwAgentVersionNotAvailableException(already implemented, lines ~155 and ~179).src/Internal/Runtime/ToolInvocationHandler.php— verify it surfaces an uncaughtAgentVersionNotAvailableExceptionas a wire error. If not, wrapresolveTool()in try/catch (see ticket Implement agent versioning name@version #18, step 4) and emitToolError(ErrorPayload::fromException($e)).src/Internal/Client/ErrorMapper.php— confirmagentVersionNotAvailable()constructs the exception with$err->details['agent']and$err->details['version'].docs/guides/errors.md— existing. Add an entry forAGENT_VERSION_NOT_AVAILABLEwith the wire shape.tests/Unit/Errors/AgentVersionNotAvailableExceptionTest.php(new)— focused unit.tests/Integration/AgentVersionErrorTest.php(new)— wire-level integration.Public API additions
Namespace
Arcp\Errors:Step-by-step changes
src/Errors/ErrorCode.php: open and confirm the enum case is present (line ~40) anddefaultRetryable()does NOT includeAgentVersionNotAvailable. The condition is a permanent failure for that version.src/Errors/AgentVersionNotAvailableException.php: confirm constructor accepts(string $agent, string $version, string $message = '', ?\Throwable $previous = null), setsdetails = ['agent' => $agent, 'version' => $version],retryable = false, andcode()returns the enum case.src/Runtime/ARCPRuntime.phpresolveTool(): confirm that when$ref->version !== null && !isset($bucket[$ref->version])it throwsnew AgentVersionNotAvailableException($ref->name, $ref->version). Re-read line ~177-181.src/Internal/Runtime/ToolInvocationHandler.phphandle(): wrap($this->resolveTool)(AgentRef::parse($msg->tool))so anAgentVersionNotAvailableExceptionbecomes a wireToolError. Suggested patch:Confirm
ErrorPayload::fromException()already serializesdetailsandretryable. If not, fix it (src/Errors/ErrorPayload.php).src/Internal/Client/ErrorMapper.phpagentVersionNotAvailable(): confirm it reads$err->details['agent']and$err->details['version'], falling back to'?'when missing or wrong type.docs/guides/errors.md: append a section under "v1.1 additions":tests/Unit/Errors/AgentVersionNotAvailableExceptionTest.php(new):testCodeEnum()— assertcode()->value === 'AGENT_VERSION_NOT_AVAILABLE'.testDetailsCarryAgentAndVersion()— instantiate, assert$e->details()['agent']and$e->details()['version']after construction.testRetryableFalse().testDefaultMessageFormat()— when$message === '',getMessage()reads"agent version not available: name@version".tests/Integration/AgentVersionErrorTest.php(new):tests/Integration/JobLifecycleTest.php).planner@1.0.0. Call$client->invokeTool('planner@9.9.9').AgentVersionNotAvailableExceptionwith$e->details()['agent'] === 'planner',version === '9.9.9', and that the underlying wireToolErrorhadcode === 'AGENT_VERSION_NOT_AVAILABLE'.CONFORMANCE.md: add a row forAGENT_VERSION_NOT_AVAILABLEunder v1.1 error codes (claim it once tests are green).Tests to add
tests/Unit/Errors/AgentVersionNotAvailableExceptionTest.php(cases above).tests/Integration/AgentVersionErrorTest.php:testInvokeUnknownVersionRaisesTypedException()testWireErrorPayloadShape()(snapshot theToolError.error.details)Verification commands
Acceptance
ErrorCode::AgentVersionNotAvailablepresent with wire stringAGENT_VERSION_NOT_AVAILABLE.AgentVersionNotAvailableExceptionthrown byARCPRuntime::resolveTool()andsetDefaultToolVersion()on unknown version.ToolInvocationHandler::handle()translates the exception to a wireToolErrorwithdetails: {agent, version}(not an uncaught throw).ErrorMapperreconstructs the typed exception on the client.docs/guides/errors.mddocuments the code.CONFORMANCE.mdclaimsAGENT_VERSION_NOT_AVAILABLE.composer stan && composer psalm && composer testall pass.