refactor: extract shared runtime foundation - #13
Merged
Merged
Conversation
tool_permission: - from_execution_policy now tolerates None-valued deny attributes, which crashed policy construction for the common `deny_tools: tuple | None` shape (getattr only falls back when the attribute is absent). - Normalize case in __post_init__ so direct construction no longer silently denies every tool a caller listed with mixed case. - Document that a single True entry in a config map makes the map an exhaustive allowlist, and lock that semantic with a test. - Widen filter() to Iterable[str]. execution_context: - normalize_execution_context deep-copies, so mutating nested scope metadata no longer writes through to persisted checkpoint state; it degrades to a shallow copy with a warning if a value is uncopyable. - role_id is authoritative for agent_id, so a stale value persisted by a previous phase no longer misattributes this role's work. runtime/events: - Give each handler its own payload copy (they interleave at every await) and let the published event_type win over one carried in the payload. - Add unsubscribe/unsubscribe_all/clear so a long-lived bus no longer retains every finished task's handler. Also re-export the new symbols from the package inits, matching the convention set by SpillStore/LLMClient, and add 11 regression tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Validation
uv run ruff check agent_core testsuv run pyright agent_core(strict, 0 errors)uv run pytest -q(483 passed)Downstream
Follow-up PRs will stack on
refactor/agent-corein ApodexHarness and FrontierAgentInternal and pin this immutable commit.