Skip to content

Dedup AgentCLI adapters: hoist read_hook_payload + resolve_model to base, drop dead CONFIG_MOUNT - #395

Merged
tildesrc merged 1 commit into
mainfrom
panopticon/agent-cli-dedup
Aug 24, 2026
Merged

Dedup AgentCLI adapters: hoist read_hook_payload + resolve_model to base, drop dead CONFIG_MOUNT#395
tildesrc merged 1 commit into
mainfrom
panopticon/agent-cli-dedup

Conversation

@tildesrc

Copy link
Copy Markdown
Contributor

Summary

  • read_hook_payload was byte-for-byte identical in claude.py and codex.py — hoisted to a single concrete implementation on AgentCLI base; adapters inherit it with no override.
  • resolve_model had the same structure in both adapters, differing only in mapping contents — hoisted to the base, reading a per-adapter MODEL_TIERS: ClassVar[Mapping[str, str]] attribute (replacing two module-level _MODEL_TIERS dicts and two overrides).
  • CONFIG_MOUNT in sessionservice/local_runner.py was a dead constant with zero callers — deleted.
  • Tests: duplicate test_read_hook_payload_tolerates_empty_and_invalid and test_resolve_model_passes_unknown_values_through moved to test_cli_base.py (tested once); per-adapter tests keep only their MODEL_TIERS mapping assertions.

Behavior-preserving refactor. make check passes (ruff + mypy + 1046 tests).

🤖 Generated with Claude Code

@tildesrc
tildesrc force-pushed the panopticon/agent-cli-dedup branch 2 times, most recently from e5f0fe8 to c899ce0 Compare August 24, 2026 15:15
…ase, drop dead CONFIG_MOUNT

read_hook_payload was byte-for-byte identical in claude.py and codex.py; resolve_model had the
same shape in both, differing only in mapping contents. Both are now single concrete implementations
on AgentCLI; adapters supply MODEL_TIERS: ClassVar[Mapping[str, str]] for per-CLI model ids.
CONFIG_MOUNT in local_runner.py was a dead constant with zero callers. Behavior-preserving refactor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tildesrc
tildesrc force-pushed the panopticon/agent-cli-dedup branch from c899ce0 to dd8a5c9 Compare August 24, 2026 15:23
@tildesrc
tildesrc merged commit 9897f81 into main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant