# Behavioral Impact

> Moved the app-level ESC cancellation cascade into a dedicated ui/esc module and delegated actioncancelrequest() to an explicit handler. This isolates ESC logic from app internals and makes the dependency inputs explicit.

- Skill: `tools-only/behavioral-impact-7` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/behavioral-impact-7`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/behavioral-impact-7/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/behavioral-impact-7

---


## Summary

Moved the app-level ESC cancellation cascade into a dedicated `ui/esc` module and delegated `action_cancel_request()` to an explicit handler. This isolates ESC logic from app internals and makes the dependency inputs explicit.

## Context

- New module: `src/tunacode/ui/esc/`
- Caller: `src/tunacode/ui/app.py` now delegates ESC handling

## Changes

- Added `EscHandler` with explicit dependency inputs for request task, shell runner, and editor state.
- Added dependency protocols in `ui/esc/types.py` to avoid coupling with concrete UI classes.
- Updated `TextualReplApp.action_cancel_request()` to delegate to the handler.

## Behavioral Impact

- No user-facing behavior changes.
- ESC handling order and early-return cascade remain identical.
- Modal ESC behavior unchanged (still handled in modal screens).

## Related Cards

- [[ui-esc-handling]]
- [[textual-app]]

