Skip to content

with_provider/with_provider_and_path constructors bypass config wiring #262

@laynepenney

Description

@laynepenney

Problem

The App::with_provider() and App::with_provider_and_path() constructors create an App with a provider already set, which means set_provider() runs before set_config() can be called. This causes the AgentConfig and system prompt to be built with default values rather than the user's config.

Current Behavior

Any code path using with_provider or with_provider_and_path (e.g., tests, alternate entry points) will silently ignore all config options — systemPromptAdditions, projectContext, commandAliases, autoApprove, etc.

Proposed Fix

Either:

  1. Remove these convenience constructors in favor of the with_project_path + set_config + set_provider pattern
  2. Or make them accept a ResolvedConfig parameter

Option 1 is simpler and avoids API surface expansion.

Related

PR #261 — Wire config options, context compaction, and auto-index on startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions