Skip to content

Fix: silent exception swallowing loses config in agent adapters#53

Merged
cemde merged 1 commit intomainfrom
fix/exception-loses-config-agent-adapter
Mar 26, 2026
Merged

Fix: silent exception swallowing loses config in agent adapters#53
cemde merged 1 commit intomainfrom
fix/exception-loses-config-agent-adapter

Conversation

@cemde
Copy link
Collaborator

@cemde cemde commented Mar 25, 2026

Description

The except Exception: pass blocks in gather_config() across smolagents, langgraph, and llamaindex adapters silently swallowed errors during config collection, causing loss of configuration data (including model_id) with no visibility into why.

This PR removes those silent catch-all blocks and lets errors propagate. For research code, truthfulness matters more than uptime — failures should be visible so they can be diagnosed and fixed.

Also simplified SmolAgentAdapter.gather_config() by removing the manual fallback that partially reconstructed config when to_dict() failed, since the error now surfaces directly.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

Contribution

Documentation

  • Added/updated docstrings for new/modified functions as instructed CONTRIBUTING.md
  • Updated relevant documentation in docs/ (if applicable)
  • Tag github issue with this PR (if applicable)

Changelog

  • Added entry to CHANGELOG.md under [Unreleased] section
  • OR this is a documentation-only change (no changelog needed)

Architecture (if applicable)

  • Core/Interface separation: Changes in maseval/core/ do NOT import from maseval/interface/
  • Dependencies: New core dependencies added sparingly; framework integrations go to optional dependencies

Additional Notes

All three agent adapters (smolagents, langgraph, llamaindex) had the same pattern of except Exception: pass in their config collection. This PR applies the same fix consistently across all three.

@cemde cemde force-pushed the fix/exception-loses-config-agent-adapter branch from 509bee1 to b374a0a Compare March 25, 2026 15:38
@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  maseval/interface/agents
  langgraph.py 218-219
  llamaindex.py
  smolagents.py
Project Total  

This report was generated by python-coverage-comment-action

The except Exception: pass blocks in smolagents, langgraph, and
llamaindex adapters silently swallowed errors during config collection,
causing loss of configuration data (including model_id) with no
visibility into why. For research code, truthfulness matters more than
uptime — let errors propagate so they can be diagnosed and fixed.

Also simplified SmolAgentAdapter.gather_config() by removing the
manual fallback that partially reconstructed config when to_dict()
failed, since the error now surfaces directly.
@cemde cemde force-pushed the fix/exception-loses-config-agent-adapter branch from b374a0a to fe31b48 Compare March 26, 2026 10:04
@cemde cemde merged commit db68df9 into main Mar 26, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant