Category: clean-code Severity: minor
Location: src/arcp/_runtime/_handlers.py:102-105
What
Catching an exception solely to raise it again is a no-op: AgentNotAvailableError (also raised by _resolve_agent) propagates identically with or without the handler, and AgentVersionNotAvailableError is re-raised unchanged. The try/except adds no behavior and obscures intent.
Evidence
try:
agent_fn, name, version = runtime._resolve_agent(submit.agent)
except AgentVersionNotAvailableError:
raise
Proposed fix
Remove the try/except and call runtime._resolve_agent(submit.agent) directly; both error types already propagate to _dispatch_one which maps them to session.error.
Acceptance criteria
Category: clean-code Severity: minor
Location:
src/arcp/_runtime/_handlers.py:102-105What
Catching an exception solely to
raiseit again is a no-op:AgentNotAvailableError(also raised by_resolve_agent) propagates identically with or without the handler, andAgentVersionNotAvailableErroris re-raised unchanged. The try/except adds no behavior and obscures intent.Evidence
Proposed fix
Remove the try/except and call
runtime._resolve_agent(submit.agent)directly; both error types already propagate to_dispatch_onewhich maps them tosession.error.Acceptance criteria
session.error; tests for unknown agent / unknown version still pass.