Skip to content

Fix heavy hitter config loading#6

Open
ptuls wants to merge 1 commit intomasterfrom
codex/fix-heavy-hitters-program-issues
Open

Fix heavy hitter config loading#6
ptuls wants to merge 1 commit intomasterfrom
codex/fix-heavy-hitters-program-issues

Conversation

@ptuls
Copy link
Copy Markdown
Owner

@ptuls ptuls commented Oct 28, 2025

Summary

  • allow the heavy hitter workflow config loader to ignore unsupported YAML keys so llm models are constructed even without an API key
  • add extra heavy hitter conversation starters to cover all islands

Testing

  • pytest

https://chatgpt.com/codex/tasks/task_e_6900a73460c8833085587f41b9dacefa

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 149 to +168
def _construct_from_dict(self, data: dict[str, Any]) -> Optional[Config]:
filtered: dict[str, Any] = {}
allowed_top = {field.name for field in fields(Config)}
for key, value in data.items():
if key in allowed_top:
filtered[key] = value

for section, schema in (
("llm", LLMConfig),
("prompt", PromptConfig),
("database", DatabaseConfig),
("evaluator", EvaluatorConfig),
):
section_data = filtered.get(section)
if isinstance(section_data, dict):
allowed_fields = {field.name for field in fields(schema)}
filtered[section] = {
name: section_data[name]
for name in allowed_fields
if name in section_data
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Filter YAML using pydantic model_fields, not dataclasses.fields

The new _construct_from_dict builds allowed_top and section field sets via dataclasses.fields(Config) and the same for LLMConfig, PromptConfig, etc. These types are pydantic BaseModels (the surrounding code already relies on Config.model_validate), so dataclasses.fields() raises TypeError: must be called with a dataclass type or instance. As a result the fallback loader now crashes whenever load_config() fails—which is exactly when this path is exercised—so heavy hitter workflows without an API key cannot load at all. Use pydantic’s model_fields (or another safe method) to enumerate allowed keys instead of dataclasses.fields.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex please fix this

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant