Skip to content

fix: isolate default component configurations - #307

Open
ningyixi wants to merge 1 commit into
Eigenwise:mainfrom
ningyixi:fix/isolate-default-component-config
Open

ningyixi wants to merge 1 commit into
Eigenwise:mainfrom
ningyixi:fix/isolate-default-component-config

Conversation

@ningyixi

Copy link
Copy Markdown

Problem

The default configuration for each of BaseTool, BaseResource, and BasePrompt is constructed once in the function signature. Instances that omit config therefore share a mutable object: setting first.config.title or .description also changes another instance's public name/description, including instances constructed later.

Changes

Use a None default and create a fresh base configuration per instance. Explicitly supplied configuration objects are retained by identity, so callers can still share a config deliberately. This changes two runtime lines in each base class; schemas and execution methods are unchanged.

Add public-behavior regression coverage for all three component types, checking existing and subsequently constructed instances, plus explicit-config identity checks. The regression test restores the original values in teardown so it also runs safely on the unfixed implementation.

Validation

Python 3.12.14, dependencies from uv sync:

  • New tests on base cbf3e3e: 3 failed, 3 passed, with all failures caused by another instance's metadata changing.
  • Base-component suite after the fix: 46 passed.
  • env -u MINIMAX_API_KEY uv run pytest --cov=atomic_agents atomic-agents: 624 passed, 3 skipped; 1,875 of 1,884 statements covered (99.5%, rounded to 99% in the report). The three live MiniMax tests were skipped; no model requests were made.
  • Full configured Black check (217 files), Flake8, and file-scoped pre-commit hooks pass.

AI assistance: prepared and verified with Codex.

This branch has not been deployed

No deployments
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