mpfaffenberger / mpfaffenberger/code_puppy

Dead code: orphaned functions in core UI/messaging/config (incl. never-fired `on_message` hook)

Open
#533 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
814
Forks
278
Avg merge
2d 5h
Merged PRs (30d)
76

Description

Summary

Candidate Location Type Confidence
_get_active_filter_text code_puppy/command_line/add_model_menu.py:216 method HIGH
update_visible_entries code_puppy/command_line/autosave_menu.py:647 closure HIGH
_render_message_immediate code_puppy/messaging/renderers.py:493 method MEDIUM
browsing (property) code_puppy/messaging/editor_history.py:123 property MEDIUM
remove_steer_queue_listener code_puppy/messaging/pause_controller.py:175 method MEDIUM
clear_observed_quick_resume_paths code_puppy/config.py:2298 function MEDIUM
set_smooth_thinking_stream code_puppy/config.py:2412 function MEDIUM
set_smooth_response_stream code_puppy/config.py:2437 function MEDIUM
on_message (trigger) code_puppy/callbacks.py:1022 function MEDIUM ⚠️ possible bug

Evidence chain

  • Static + grep: zero references repo-wide (Python + docs/configs) for all of the above.
  • Runtime trace: full suite (11,691 tests), none executed.
  • Git history:
    • _get_active_filter_text — leftover from live-filtering PR #262 (ab8e32ce).
    • update_visible_entries — orphaned by PUP-346 / search keybinding rework (#500, 0f8bbfca); its docstring still claims it's "used for the picker's initial setup".
    • clear_observed_quick_resume_paths — unused since quick-resume feature landed (#501).
    • set_smooth_*_stream — the /set menu writes through generic set_config_value(key, ...) (set_menu_catalog.py:499-518); only the getters are consumed (agents/smooth_stream.py).
  • ⚠️ on_message: "on_message" is a registered hook name in callbacks.py (lines 46, 101), so plugins can register callbacks for it — but the trigger function on_message() is never called anywhere in the codebase. Registered callbacks silently never fire. This is either dead code to remove or a regression to fix (possibly related to 26d831cd "remove browser terminal subsystem and REST API").
  • _render_message_immediate docstring says "Public-ish for tests/teardown" — but no test or teardown path calls it.
  • remove_steer_queue_listener: the matching add_steer_queue_listener IS used (plugins/steer_queue/register_callbacks.py:114) but nothing ever unregisters — either wire up cleanup or drop the method.

Caveats

  • config.py setters are public API of a published package; external consumers possible.
  • Decide on_message intent (fix vs. remove) before deleting.

Verification

pytest tests/ -q --no-cov

Filed by dead-code-detective-9a7d4c. Findings are read-only analysis; deletion requires human review.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the listed symbols in code_puppy/command_line, code_puppy/messaging, code_puppy/config.py, and code_puppy/callbacks.py, starting with the reported repository-wide references and git history. Resolve whether on_message should be fixed or removed and assess the public config setters before changing them. Done means the approved dead code is removed or repaired, with pytest tests/ -q --no-cov passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.