fix(metadata): give gpt-5-mini reasoning headroom for tagging/validation succeed#250
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes metadata tagging/validation failures caused by gpt-5-mini exhausting its token budget on reasoning, which led to systematic fallbacks (category="Other" / valid_question=True) and silent mislabeling in the metadata pipeline under src/metadata/.
Changes:
- Configure metadata LLM calls to use
reasoning={"effort": "minimal"}to prevent reasoning-token starvation. - Increase
max_output_tokensfor tagging (50 → 512) and validation (500 → 1024) to give responses enough output budget. - Relax the request-parameter unit test to assert that a reasoning policy is present without pinning an exact effort value.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/helpers/metadata_llm.py |
Adds a minimal reasoning policy to metadata model requests to avoid incomplete responses. |
src/metadata/tag_questions/main.py |
Increases tagging output budget to reduce incomplete/empty outputs and fallback categorization. |
src/metadata/validate_questions/main.py |
Increases validation output budget to reduce incomplete outputs and fallback validity labeling. |
src/tests/test_model_request_params.py |
Updates test expectations to require a reasoning policy while avoiding brittle effort-value assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf530c7 to
6351a60
Compare
|
@houtanb This is a good catch for a bug and raises the possibility that not all LLM args/setup is being forwarded/works exactly as expected. Perhaps a smoke test-like cli can run a few more reqests and check outputs for systematic problems/refusals. But that's separate. LGTM |
6351a60 to
6d01eea
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis change adds ChangesMetadata LLM budget and reasoning fix
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…idation `gpt-5-mini` is a reasoning model, so a 50-token cap with default (medium) reasoning returns `status=incomplete (max_output_tokens)` and every question silently fell back to `category="Other"` / `valid_question=True`. Set reasoning effort to `minimal` and raise the output budgets so tagging and validation complete.
6d01eea to
067519a
Compare
Fixes #249
gpt-5-miniis a reasoning model. Calling it withmax_output_tokens=50(tag) /500(validate) and default (
medium) reasoning makes it exhaust the budget on reasoning tokens andreturn
status=incomplete (max_output_tokens)every time, so metadata silently fell back tocategory="Other"/valid_question=True.Changes
helpers/metadata_llm.py: passreasoning={"effort": "minimal"}(covers tag + validate).tag_questions/main.py:max_output_tokens50 → 512.validate_questions/main.py:max_output_tokens500 → 1024.test_model_request_params.py: assert a reasoning policy is present rather than pinning theexact effort value, so future model/reasoning/budget changes don't break the test.
Summary by CodeRabbit
New Features
Bug Fixes
Tests