Goal
Remove the planning feature entirely from tunacode. The feature (a read-only mode restricting agent to information gathering before code modifications) is not actively used and adds maintenance burden across 9 layers.
Non-goals:
- Refactoring related code beyond deletion
- Adding new features to replace planning
- Touching unrelated failing tests (Gate 2 dependency work)
Scope & Assumptions
In scope:
- Delete 4 files (tool, prompt, UI panel, tests)
- Modify 17 files to remove planning references
- Update 4 documentation files
Out of scope:
- The failing "layers" test (Gate 2 work, unrelated)
- Any functionality enhancements
Assumptions:
- No external integrations depend on
/plan command
- All planning code is captured in the research doc
- Branch
delete-plan is the working branch
Deliverables (DoD)
| Artifact |
Acceptance Criteria |
| Clean deletion |
All 4 files deleted, no orphaned imports |
| No regressions |
uv run pytest passes (except known Gate 2 failures) |
| No type errors |
uv run mypy shows no NEW errors |
| Clean lint |
uv run ruff check . passes |
| Updated docs |
All codebase-map references removed |
Readiness (DoR)
Milestones
- M1: Delete standalone files (tests, prompts, UI panel)
- M2: Remove tool registration and delete tool implementation
- M3: Remove authorization layer references
- M4: Remove UI command and state references
- M5: Remove types, constants, and update documentation
Work Breakdown (Tasks)
Task 1: Delete Standalone Files (M1)
Summary: Delete files with no dependents
Owner: agent
Dependencies: none
Files:
- DELETE
tests/unit/core/test_present_plan.py
- DELETE
src/tunacode/tools/prompts/present_plan_prompt.xml
- DELETE
src/tunacode/ui/plan_approval.py
Acceptance Tests:
- Files no longer exist
- No import errors when running pytest
Task 2: Remove Tool Registration & Delete Tool (M2)
Summary: Unregister from agent, then delete tool
Owner: agent
Dependencies: Task 1
Files:
- MODIFY
src/tunacode/core/agents/agent_components/agent_config.py - remove present_plan registration (~lines 433-435)
- DELETE
src/tunacode/tools/present_plan.py
Acceptance Tests:
- Agent initializes without present_plan tool
- No import errors
Task 3: Remove Authorization Layer (M3)
Summary: Remove plan mode blocking rules
Owner: agent
Dependencies: Task 2
Files:
- MODIFY
src/tunacode/tools/authorization/factory.py - remove PlanModeBlockRule import/registration
- MODIFY
src/tunacode/tools/authorization/rules.py - remove PlanModeBlockRule class, PLAN_MODE_BLOCKED_TOOLS
- MODIFY
src/tunacode/tools/authorization/context.py - remove plan_mode field
Acceptance Tests:
- Authorization system works without plan_mode
- Tool authorization tests pass
Task 4: Remove UI Command & State (M4)
Summary: Remove /plan command and approval handling
Owner: agent
Dependencies: Task 3
Files:
- MODIFY
src/tunacode/ui/commands/__init__.py - remove PlanCommand class
- MODIFY
src/tunacode/ui/app.py - remove request_plan_approval(), _handle_plan_approval_key(), pending_plan_approval
- MODIFY
src/tunacode/ui/repl_support.py - remove PendingPlanApprovalState
- MODIFY
src/tunacode/ui/welcome.py - remove /plan mention
- MODIFY
src/tunacode/core/state.py - remove plan_mode, plan_approval_callback
Acceptance Tests:
- App starts without plan-related attributes
- /plan command no longer available
- Welcome message doesn't mention /plan
Task 5: Remove Types, Constants & Update Docs (M5)
Summary: Clean up type definitions and documentation
Owner: agent
Dependencies: Task 4
Files:
- MODIFY
src/tunacode/types/callbacks.py - remove PlanApprovalCallback
- MODIFY
src/tunacode/types/state.py - remove PlanSessionProtocol, PlanApprovalProtocol
- MODIFY
src/tunacode/types/__init__.py - remove planning exports
- MODIFY
src/tunacode/constants.py - remove EXIT_PLAN_MODE_SENTINEL, update READ_ONLY_TOOLS
- MODIFY
docs/codebase-map/modules/types.md
- MODIFY
docs/codebase-map/modules/ui-overview.md
- MODIFY
docs/codebase-map/structure/02-core-directory.md
- MODIFY
docs/codebase-map/structure/tree-structure.txt
Acceptance Tests:
- No orphaned type exports
- Documentation accurate
- Full test suite passes
Risks & Mitigations
| Risk |
Impact |
Likelihood |
Mitigation |
Trigger |
| Hidden dependency on planning |
High |
Low |
Research doc is comprehensive |
Import error during deletion |
| Merge conflicts with master |
Medium |
Low |
Working on dedicated branch |
Rebase before merge |
| Type errors cascade |
Medium |
Medium |
Delete in dependency order |
Mypy fails after deletion |
Test Strategy
- Run
uv run pytest after each task to catch regressions immediately
- One verification run of full test suite at end
- No new tests needed (deleting feature, not adding)
References
- Research doc:
memory-bank/research/2026-01-26_planning-feature-deletion.md
- Main tool:
src/tunacode/tools/present_plan.py
- UI panel:
src/tunacode/ui/plan_approval.py
- Authorization:
src/tunacode/tools/authorization/rules.py
Tickets Created (max 5)
| Ticket ID |
Title |
Priority |
Status |
| tun-2ef4 |
Delete standalone planning files (tests, prompts, UI panel) |
1 |
open |
| tun-6d0a |
Remove present_plan tool registration and delete tool |
1 |
open |
| tun-0de7 |
Remove authorization layer planning references |
2 |
open |
| tun-216b |
Remove UI command and state references |
2 |
open |
| tun-4014 |
Remove planning types, constants, and update docs |
2 |
open |
Dependencies
tun-2ef4 (Phase 1: Delete standalone files)
└── tun-6d0a (Phase 2: Remove tool registration)
└── tun-0de7 (Phase 3: Authorization layer)
└── tun-216b (Phase 4: UI command/state)
└── tun-4014 (Phase 5: Types/constants/docs)
1---2name: 494-2026-01-26-14-30-00-planning-feature-deletion-d3530f3c3description: Goal4---56## Goal78**Remove the planning feature entirely from tunacode.** The feature (a read-only mode restricting agent to information gathering before code modifications) is not actively used and adds maintenance burden across 9 layers.910**Non-goals:**11- Refactoring related code beyond deletion12- Adding new features to replace planning13- Touching unrelated failing tests (Gate 2 dependency work)1415## Scope & Assumptions1617**In scope:**18- Delete 4 files (tool, prompt, UI panel, tests)19- Modify 17 files to remove planning references20- Update 4 documentation files2122**Out of scope:**23- The failing "layers" test (Gate 2 work, unrelated)24- Any functionality enhancements2526**Assumptions:**27- No external integrations depend on `/plan` command28- All planning code is captured in the research doc29- Branch `delete-plan` is the working branch3031## Deliverables (DoD)3233| Artifact | Acceptance Criteria |34|----------|---------------------|35| Clean deletion | All 4 files deleted, no orphaned imports |36| No regressions | `uv run pytest` passes (except known Gate 2 failures) |37| No type errors | `uv run mypy` shows no NEW errors |38| Clean lint | `uv run ruff check .` passes |39| Updated docs | All codebase-map references removed |4041## Readiness (DoR)4243- [x] Research document complete with full file/line mapping44- [x] Git branch `delete-plan` exists45- [x] Working directory clean4647## Milestones4849- **M1:** Delete standalone files (tests, prompts, UI panel)50- **M2:** Remove tool registration and delete tool implementation51- **M3:** Remove authorization layer references52- **M4:** Remove UI command and state references53- **M5:** Remove types, constants, and update documentation5455## Work Breakdown (Tasks)5657### Task 1: Delete Standalone Files (M1)58**Summary:** Delete files with no dependents59**Owner:** agent60**Dependencies:** none61**Files:**62- DELETE `tests/unit/core/test_present_plan.py`63- DELETE `src/tunacode/tools/prompts/present_plan_prompt.xml`64- DELETE `src/tunacode/ui/plan_approval.py`6566**Acceptance Tests:**67- Files no longer exist68- No import errors when running pytest6970---7172### Task 2: Remove Tool Registration & Delete Tool (M2)73**Summary:** Unregister from agent, then delete tool74**Owner:** agent75**Dependencies:** Task 176**Files:**77- MODIFY `src/tunacode/core/agents/agent_components/agent_config.py` - remove present_plan registration (~lines 433-435)78- DELETE `src/tunacode/tools/present_plan.py`7980**Acceptance Tests:**81- Agent initializes without present_plan tool82- No import errors8384---8586### Task 3: Remove Authorization Layer (M3)87**Summary:** Remove plan mode blocking rules88**Owner:** agent89**Dependencies:** Task 290**Files:**91- MODIFY `src/tunacode/tools/authorization/factory.py` - remove PlanModeBlockRule import/registration92- MODIFY `src/tunacode/tools/authorization/rules.py` - remove PlanModeBlockRule class, PLAN_MODE_BLOCKED_TOOLS93- MODIFY `src/tunacode/tools/authorization/context.py` - remove plan_mode field9495**Acceptance Tests:**96- Authorization system works without plan_mode97- Tool authorization tests pass9899---100101### Task 4: Remove UI Command & State (M4)102**Summary:** Remove /plan command and approval handling103**Owner:** agent104**Dependencies:** Task 3105**Files:**106- MODIFY `src/tunacode/ui/commands/__init__.py` - remove PlanCommand class107- MODIFY `src/tunacode/ui/app.py` - remove request_plan_approval(), _handle_plan_approval_key(), pending_plan_approval108- MODIFY `src/tunacode/ui/repl_support.py` - remove PendingPlanApprovalState109- MODIFY `src/tunacode/ui/welcome.py` - remove /plan mention110- MODIFY `src/tunacode/core/state.py` - remove plan_mode, plan_approval_callback111112**Acceptance Tests:**113- App starts without plan-related attributes114- /plan command no longer available115- Welcome message doesn't mention /plan116117---118119### Task 5: Remove Types, Constants & Update Docs (M5)120**Summary:** Clean up type definitions and documentation121**Owner:** agent122**Dependencies:** Task 4123**Files:**124- MODIFY `src/tunacode/types/callbacks.py` - remove PlanApprovalCallback125- MODIFY `src/tunacode/types/state.py` - remove PlanSessionProtocol, PlanApprovalProtocol126- MODIFY `src/tunacode/types/__init__.py` - remove planning exports127- MODIFY `src/tunacode/constants.py` - remove EXIT_PLAN_MODE_SENTINEL, update READ_ONLY_TOOLS128- MODIFY `docs/codebase-map/modules/types.md`129- MODIFY `docs/codebase-map/modules/ui-overview.md`130- MODIFY `docs/codebase-map/structure/02-core-directory.md`131- MODIFY `docs/codebase-map/structure/tree-structure.txt`132133**Acceptance Tests:**134- No orphaned type exports135- Documentation accurate136- Full test suite passes137138---139140## Risks & Mitigations141142| Risk | Impact | Likelihood | Mitigation | Trigger |143|------|--------|------------|------------|---------|144| Hidden dependency on planning | High | Low | Research doc is comprehensive | Import error during deletion |145| Merge conflicts with master | Medium | Low | Working on dedicated branch | Rebase before merge |146| Type errors cascade | Medium | Medium | Delete in dependency order | Mypy fails after deletion |147148## Test Strategy149150- Run `uv run pytest` after each task to catch regressions immediately151- One verification run of full test suite at end152- No new tests needed (deleting feature, not adding)153154## References155156- Research doc: `memory-bank/research/2026-01-26_planning-feature-deletion.md`157- Main tool: `src/tunacode/tools/present_plan.py`158- UI panel: `src/tunacode/ui/plan_approval.py`159- Authorization: `src/tunacode/tools/authorization/rules.py`160161## Tickets Created (max 5)162163| Ticket ID | Title | Priority | Status |164|-----------|-------|----------|--------|165| tun-2ef4 | Delete standalone planning files (tests, prompts, UI panel) | 1 | open |166| tun-6d0a | Remove present_plan tool registration and delete tool | 1 | open |167| tun-0de7 | Remove authorization layer planning references | 2 | open |168| tun-216b | Remove UI command and state references | 2 | open |169| tun-4014 | Remove planning types, constants, and update docs | 2 | open |170171## Dependencies172173```174tun-2ef4 (Phase 1: Delete standalone files)175 └── tun-6d0a (Phase 2: Remove tool registration)176 └── tun-0de7 (Phase 3: Authorization layer)177 └── tun-216b (Phase 4: UI command/state)178 └── tun-4014 (Phase 5: Types/constants/docs)179```