mpfaffenberger / mpfaffenberger/code_puppy
Silent except-pass swallows real failures: plugin tool registration, shell reader threads, and file-modification helpers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Description
Files (theme: silent failure of core wiring):
code_puppy/tools/__init__.py:204-207-_load_plugin_tools():
except Exception:
# Don't let plugin failures break core functionality
pass
If on_register_tools() blows up, ALL plugin-provided tools silently vanish from TOOL_REGISTRY. The agent then emits "Unknown tool 'X' requested, skipping..." with no hint of the root cause. At minimum emit_warning/logger.exception here.
code_puppy/tools/command_runner.py- theread_stdout/read_stderrreader threads end in stacked
except (ValueError, OSError):
pass
except Exception:
pass
(lines ~760-775 and ~830-840). The second handler swallows everything including programming errors in the reader; a reader thread dying mid-stream means truncated output reported as a clean result. Log the exception (even debug-level) before exiting the thread, and drop the redundant first handler.
code_puppy/tools/file_modifications.py-_delete_snippet_from_file/_replace_in_fileend withexcept Exception as exc: return {"error": str(exc), "diff": diff_text}- acceptable as a tool boundary, but unlike_write_to_filethey don't call_log_error, so tracebacks for genuine bugs are lost. Inconsistent error-handling strategy within one module; add_log_error(..., exc)to match.
Roughly 40 except Exception: handlers exist in tools/ alone; most are fine (UI best-effort), but the three above hide real wiring/IO failures. Errors should never pass silently unless explicitly silenced - these aren't explicit, they're invisible.
Filed by Zen Reviewer B (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 with _load_plugin_tools() in code_puppy/tools/init.py, the read_stdout/read_stderr threads in code_puppy/tools/command_runner.py, and _delete_snippet_from_file/_replace_in_file in code_puppy/tools/file_modifications.py. Trace how each exception is currently handled, then verify that plugin, reader-thread, and file-helper failures are no longer silent while the existing tool-boundary error results remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100