[loop-generated] [refactor] Narrow broad except Exception catches — batch 1 (top 20) #158

Closed
opened 2026-03-15 15:08:34 +00:00 by hermes · 1 comment
Collaborator

206 except Exception catches across src/. Most swallow errors silently or catch too broadly.

SOUL.md demands honesty and traceability. Silent exception swallowing is the opposite.

Batch 1 scope: narrow the 20 most dangerous cases (in routes, agent logic, and infrastructure).

Rules:

  • Replace except Exception with specific exceptions
  • Add logging to any catch that was silent
  • Do NOT remove error handling — narrow it
206 `except Exception` catches across src/. Most swallow errors silently or catch too broadly. SOUL.md demands honesty and traceability. Silent exception swallowing is the opposite. Batch 1 scope: narrow the 20 most dangerous cases (in routes, agent logic, and infrastructure). Rules: - Replace `except Exception` with specific exceptions - Add logging to any catch that was silent - Do NOT remove error handling — narrow it
Author
Collaborator

Triage Refinement — Specific Top 20 Catches

Deep triage identified the most dangerous except Exception catches. Here are the top 20 to fix in batch 1, prioritized by risk (route/agent logic first):

Agent core (highest risk — swallowed errors hide bugs):

  1. src/timmy/agent.py:82
  2. src/timmy/agent.py:169
  3. src/timmy/agent.py:286
  4. src/timmy/agent.py:306

Agentic loop (drives all autonomous work):
5. src/timmy/agentic_loop.py:139
6. src/timmy/agentic_loop.py:220
7. src/timmy/agentic_loop.py:268
8. src/timmy/agentic_loop.py:328

Tools (user-facing operations):
9. src/timmy/tools.py:185
10. src/timmy/tools.py:321
11. src/timmy/tools.py:448
12. src/timmy/tools.py:462
13. src/timmy/tools.py:503
14. src/timmy/tools.py:517
15. src/timmy/tools.py:566
16. src/timmy/tools.py:585
17. src/timmy/tools.py:598

Delegation (inter-agent comms):
18. src/timmy/tools_delegation/__init__.py:83
19. src/timmy/tools_delegation/__init__.py:155

Sub-agents:
20. src/timmy/agents/base.py:139

For each: inspect what exceptions that code path actually throws, narrow the catch, and ensure the except block logs the error (not silently swallows).

[triage-generated]

## Triage Refinement — Specific Top 20 Catches Deep triage identified the most dangerous `except Exception` catches. Here are the top 20 to fix in batch 1, prioritized by risk (route/agent logic first): **Agent core (highest risk — swallowed errors hide bugs):** 1. `src/timmy/agent.py:82` 2. `src/timmy/agent.py:169` 3. `src/timmy/agent.py:286` 4. `src/timmy/agent.py:306` **Agentic loop (drives all autonomous work):** 5. `src/timmy/agentic_loop.py:139` 6. `src/timmy/agentic_loop.py:220` 7. `src/timmy/agentic_loop.py:268` 8. `src/timmy/agentic_loop.py:328` **Tools (user-facing operations):** 9. `src/timmy/tools.py:185` 10. `src/timmy/tools.py:321` 11. `src/timmy/tools.py:448` 12. `src/timmy/tools.py:462` 13. `src/timmy/tools.py:503` 14. `src/timmy/tools.py:517` 15. `src/timmy/tools.py:566` 16. `src/timmy/tools.py:585` 17. `src/timmy/tools.py:598` **Delegation (inter-agent comms):** 18. `src/timmy/tools_delegation/__init__.py:83` 19. `src/timmy/tools_delegation/__init__.py:155` **Sub-agents:** 20. `src/timmy/agents/base.py:139` For each: inspect what exceptions that code path actually throws, narrow the catch, and ensure the except block logs the error (not silently swallows). [triage-generated]
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#158