refactor(runtime): extract shared exceptions from watchdog.errors - #84
Open
LicsDaSheng wants to merge 1 commit into
Open
refactor(runtime): extract shared exceptions from watchdog.errors#84LicsDaSheng wants to merge 1 commit into
LicsDaSheng wants to merge 1 commit into
Conversation
The exception hierarchy and failure mapping previously lived in PhyAgentOS.runtime.watchdog.errors, forcing lower-level modules (Target, Policy, Adapter, Perception, Communication, Perception Plugins) to depend on the Session orchestration package — a dependency inversion. Move the shared types to a neutral PhyAgentOS.runtime.errors module; watchdog.errors becomes a re-export compatibility layer so existing imports keep working. Migrate all affected lower-level modules to import from PhyAgentOS.runtime.errors. Closes PhyAgentOS-dev#83
LicsDaSheng
force-pushed
the
issue-83-runtime-errors
branch
from
August 11, 2026 08:49
77b006e to
4db85a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #83 — the dependency inversion where lower-level runtime modules (Target, Policy, Adapter, Perception, Communication, Perception Plugins) imported shared exception types from
PhyAgentOS.runtime.watchdog.errors, the Session execution orchestration layer.Changes
PhyAgentOS/runtime/errors.pynow hosts the shared exception hierarchy (RuntimeErrorBase,SchemaValidationError,Target*Error,AdapterError,Policy*Error,SessionTimeoutError) plus theerror_code_for/terminal_status_forfailure mapping helpers, moved verbatim from the watchdog package.PhyAgentOS/runtime/watchdog/errors.pybecomes a pure re-export ofPhyAgentOS.runtime.errors, so existing imports keep working unchanged.PhyAgentOS.runtime.errors. The watchdog package internals, CLI, agent, scripts, and preflight keep their (correct-direction) dependencies on the orchestration layer.Testing
tests/runtime/test_runtime_errors.py(22 cases): exception hierarchy,error_code_formapping incl. most-specific-subclass precedence,terminal_status_formapping, and identity assertions thatwatchdog.errorsre-exports the same objects.test_session_runner_dispatch.py, which itself exercises the compatibility layer).ruffclean (only a pre-existing N806 inlerobot_pi0_server.pyremains, unrelated to this change);compileallpasses.tests/runtime/test_piper_dual_arm_builtin.pyfails collection onpreviewbecause it references a module (piper_dual_arm) that does not exist in this branch — pre-existing issue, unrelated to this change.Closes #83