Skip to content

Fix: Configuration Error when running dsagent without --model or config #47

@nmlemus

Description

@nmlemus

Bug

Running dsagent or dsagent chat without --model and without any config (no .env, no DSAGENT_DEFAULT_MODEL/LLM_MODEL) causes:

Configuration Error: 'NoneType' object has no attribute 'lower'

Cause: args.model is None and validate_configuration(None) calls model.lower() internally.

Expected behavior

  • Without config, the CLI should use the default model (e.g. gpt-4o) and only fail with a clear message if the API key for that model is missing.
  • No config file should be required to run dsagent.

Fix (to be done in a branch/PR)

  1. Resolve the effective model with get_default_model(explicit=args.model) before calling validate_configuration() in CLI entry points (repl.py, run.py, cli.py).
  2. Use that effective_model for validation and when creating the agent.
  3. In validate_configuration(), guard against None/empty and raise a clear ConfigurationError instead of AttributeError.

Release: 0.9.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions