Decompose tools_execution.py (924 lines)#2143
Merged
Merged
Conversation
Trecek
commented
May 7, 2026
Collaborator
Author
Trecek
left a comment
There was a problem hiding this comment.
AutoSkillit PR Review — Verdict: changes_requested
Trecek
commented
May 7, 2026
Collaborator
Author
Trecek
left a comment
There was a problem hiding this comment.
AutoSkillit review: 2 blocking findings require changes before merge. See inline comments for details.
Split src/autoskillit/server/tools/tools_execution.py (924 lines, 5 MCP tool handlers) into three modules: - tools_execution.py (~515 lines): retains run_cmd, run_python, run_skill - tools_fleet_dispatch.py (~247 lines): dispatch_food_truck, record_gate_dispatch - tools_execution_helpers.py (~191 lines): _import_and_call, _coerce_scalar No behavioral changes. All tests pass with updated import paths. Added structural guard test for decomposition boundaries. Updated arch test caps (server/tools: 16→18) and layer enforcement scans. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ecution — used only in helpers
…osition guard tests
… to execution failure logger
…sult, ValueError fallback for FleetErrorCode
…patch_food_truck campaign state block
…py; add negative hasattr guards; update module count to 15
…port_and_call is not in tools_execution namespace
1e08d49 to
58ea1fa
Compare
Trecek
added a commit
that referenced
this pull request
May 8, 2026
## Summary Split `src/autoskillit/server/tools/tools_execution.py` (924 lines, 5 MCP tool handlers + helpers) into three cohesive modules: 1. **`tools_execution.py`** (~510 lines) — retains `run_cmd`, `run_python`, `run_skill` (the three execution primitives) 2. **`tools_fleet_dispatch.py`** (~240 lines) — `dispatch_food_truck`, `record_gate_dispatch`, and `_get_food_truck_prompt_builder` 3. **`tools_execution_helpers.py`** (~190 lines) — `_coerce_scalar`, `_import_and_call`, `_RUN_PYTHON_SENTINEL_KEYS` No behavioral changes. All existing tests pass with import path updates. Do not leave re-export shims, backward-compatibility aliases, or comments referencing this decomposition in the source code — the codebase is not a notepad. ## Implementation Plan Plan file: `/home/talon/projects/autoskillit-runs/impl-20260506-230442-623894/.autoskillit/temp/make-plan/decompose_tools_execution_plan_2026-05-06_230900.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> ## Token Usage Summary | Step | Model | count | uncached | output | cache_read | peak_ctx | turns | cache_write | time | |------|-------|-------|----------|--------|------------|----------|-------|-------------|------| | plan | claude-opus-4-6 | 1 | 86 | 14.7k | 1.6M | 71.3k | 113 | 66.9k | 10m 41s | | verify | claude-sonnet-4-6 | 1 | 46 | 9.3k | 1.1M | 76.8k | 129 | 63.7k | 6m 14s | | implement* | MiniMax-M2.7-highspeed | 1 | 2.1M | 21.8k | 1.8M | 57.4k | 133 | 108.6k | 8m 47s | | prepare_pr* | MiniMax-M2.7-highspeed | 1 | 64.5k | 3.3k | 172.2k | 28.7k | 20 | 41.1k | 1m 21s | | compose_pr* | MiniMax-M2.7-highspeed | 1 | 79.3k | 1.8k | 284.1k | 28.7k | 24 | 15.0k | 52s | | **Total** | | | 2.3M | 50.7k | 5.0M | 76.8k | | 295.2k | 27m 58s | \* *Step used a non-Anthropic provider; caching behavior may differ.* ## Token Efficiency | Step | LoC Changed | cache_read/LoC | cache_write/LoC | output/LoC | |------|-------------|----------------|-----------------|------------| | plan | 0 | — | — | — | | verify | 0 | — | — | — | | implement | 964 | 1868.5 | 112.7 | 22.6 | | prepare_pr | 0 | — | — | — | | compose_pr | 0 | — | — | — | | **Total** | **964** | 5157.3 | 306.3 | 52.6 | ## Model Usage Breakdown | Model | steps | uncached | output | cache_read | cache_write | time | |-------|-------|----------|--------|------------|-------------|------| | claude-opus-4-6 | 1 | 86 | 14.7k | 1.6M | 66.9k | 10m 41s | | claude-sonnet-4-6 | 1 | 46 | 9.3k | 1.1M | 63.7k | 6m 14s | | MiniMax-M2.7-highspeed | 3 | 2.3M | 26.8k | 2.3M | 164.7k | 11m 1s | --------- Co-authored-by: Claude Opus 4.7 <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
Split
src/autoskillit/server/tools/tools_execution.py(924 lines, 5 MCP tool handlers + helpers) into three cohesive modules:tools_execution.py(~510 lines) — retainsrun_cmd,run_python,run_skill(the three execution primitives)tools_fleet_dispatch.py(~240 lines) —dispatch_food_truck,record_gate_dispatch, and_get_food_truck_prompt_buildertools_execution_helpers.py(~190 lines) —_coerce_scalar,_import_and_call,_RUN_PYTHON_SENTINEL_KEYSNo behavioral changes. All existing tests pass with import path updates. Do not leave re-export shims, backward-compatibility aliases, or comments referencing this decomposition in the source code — the codebase is not a notepad.
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260506-230442-623894/.autoskillit/temp/make-plan/decompose_tools_execution_plan_2026-05-06_230900.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown