Skip to content

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

Open
Ahmed-Ali-313 wants to merge 4 commits 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 4 commits 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
@Ahmed-Ali-313
Ahmed-Ali-313 force-pushed the fix/improve-error-messages branch from 30ee537 to 06493d2 Compare July 29, 2026 18:18
@Ahmed-Ali-313

Copy link
Copy Markdown
Author

Hi team, I have updated the branch and fixed the automated scan failure. The tests are now passing successfully. Could a maintainer please approve the remaining workflows and review these changes when you have a moment? Thank you!

@Ahmed-Ali-313

Copy link
Copy Markdown
Author

@DeanChensj Hi! Just following up on this when you have a moment. I have successfully updated the branch to clear out conflicts. Could you please approve the workflows so the automated checks can run? Thank you!

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