mpfaffenberger / mpfaffenberger/code_puppy
Minor cleanups: dead allow_legacy param, keymap cancel/pause duplication, inline clipboard fallback, lefthook isort never installed, undocumented keybinding config
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Description
Problem
Grouped minor cleanups across the UI/session/infra layer (each too small for its own issue, all concrete):
-
Dead parameter:
session_storage.py:121-126—load_session(..., allow_legacy: bool = False)is immediately discarded (_ = allow_legacy # Kept for API compatibility). Deprecate and remove; grep shows callers don't pass it. -
Near-duplicate function family in
keymap.py:get_cancel_agent_key/validate_cancel_agent_key/get_cancel_agent_char_code/get_cancel_agent_display_name(lines 96-167) are mirrored verbatim by the pause variants (lines 175-228), differing only in config key, valid-key set, default, and uvx override. One parametrized helper (_get_key(config_key, default, uvx_override)etc.) halves the module and keeps the two features from drifting. -
Inline clipboard re-implementation: the Ctrl+V fallback in
prompt_toolkit_completion.py(~lines 700-760) shells out topbpaste/powershell Get-Clipboard/xclip/xselinline, whilecommand_line/clipboard.pyis the designated cross-platform clipboard module. Move text-clipboard reading intoclipboard.py(get_clipboard_text() -> Optional[str]) and call it from the key binding. -
Commented-out corpse at the top of
prompt_toolkit_completion.py(lines 1-8): dead ANSI color constants kept "in case someone needs raw ANSI later". Delete — git remembers. -
lefthook.ymlreferences isort, which is not a dev dependency — theisortpre-commit command always takes the "isort not found; using ruff import sorter" fallback path on a fresh clone (verified: no isort in pyproject/uv.lock). Either add isort to the dev group or delete the command and keep onlyruff check --select I --fix. -
docs/only covers AGENT_SKILLS / CEREBRAS / HOOKS / LEFTHOOK — none of the session/autosave/keymap behavior reviewed here is documented anywhere except code comments (e.g., thecancel_agent_key/pause_agent_keyconfig keys and their valid values inkeymap.pyare discoverable only by reading source). A shortdocs/KEYBINDINGS.mdwould cover it.
Suggested fix
Each item above contains its fix; all are independent, low-risk deletions/extractions suitable for a cleanup PR.
Filed by Zen Reviewer C (code-puppy-60635a)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading session_storage.py, keymap.py, prompt_toolkit_completion.py, command_line/clipboard.py, lefthook.yml, and the existing docs. Check callers and project configuration before making the independent cleanup changes, then run the available checks and verify the keybinding and clipboard behavior. Done means the dead parameter and constants are removed, duplicated clipboard logic is centralized, lefthook is consistent, and the keybinding behavior is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ci-cd, cli, documentation, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100