Skip to content

fix(core): improve clarity and actionable context in error messages - #6487

Open
Ahmed-Ali-313 wants to merge 1 commit into
google:mainfrom
Ahmed-Ali-313:fix/improve-error-messages
Open

fix(core): improve clarity and actionable context in error messages#6487
Ahmed-Ali-313 wants to merge 1 commit into
google:mainfrom
Ahmed-Ali-313:fix/improve-error-messages

Conversation

@Ahmed-Ali-313

Copy link
Copy Markdown

Link to Issue or Description of Change

Problem:
Several core error messages in runners.py, llm_agent.py, llm_request.py, and llm_agent_config.py were vague, missing the actual input values/types, or lacked guidance on how developers could fix the configuration issue.

Solution:

  1. Updated Runner._resolve_app to output actual provided arguments/types.
  2. Enhanced LlmAgent.set_default_model and set_default_live_model to report type(model).__name__.
  3. Added actionable suggestions to LlmAgent.validate_generate_content_config explaining where to place tools, instruction, output_schema, and http_options.
  4. Included actual types in LlmRequest.append_instructions and values in LlmAgentConfig._validate_model_sources.
  5. Created unit tests in test_improved_error_messages.py.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change (tests/unittests/agents/test_improved_error_messages.py).
  • All unit tests pass locally.

Pytest Summary:
13 passed in 4.64s

Manual End-to-End (E2E) Tests:
Verified that triggering misconfigurations (e.g., passing invalid model types or duplicate Runner arguments) now prints rich, actionable error tracebacks.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.

@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants