Skip to content

Claude/check 011 cv33gddu b qs l4 quyw86z c#19

Merged
anamsarfraz merged 4 commits intoclaude/still-disco-011CUzRCZPvjPRrbz1VNy2CYfrom
claude/check-011CV33gdduBQsL4Quyw86zC
Nov 12, 2025
Merged

Claude/check 011 cv33gddu b qs l4 quyw86z c#19
anamsarfraz merged 4 commits intoclaude/still-disco-011CUzRCZPvjPRrbz1VNy2CYfrom
claude/check-011CV33gdduBQsL4Quyw86zC

Conversation

@anamsarfraz
Copy link
Copy Markdown
Contributor

Pull Request

Description

Brief description of the changes in this PR.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code cleanup/refactoring

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • No testing needed

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Related Issues

Closes #(issue number)

Screenshots (if applicable)

Add screenshots to help explain your changes.

Additional Notes

Any additional information that reviewers should know.

anamsarfraz and others added 4 commits November 12, 2025 10:27
…RCZPvjPRrbz1VNy2CY

Claude/still disco 011 c uz rcz pvj p rrbz1 v ny2 cy
PROBLEM:
gpt-5 (Azure deployment) was failing silently - not generating any responses.
gpt-4.1-mini worked but gpt-5 didn't.

ROOT CAUSE:
Recent merge changed 'max_tokens' to 'max_completion_tokens' in:
- _call_openai() line 295
- _call_azure_openai_custom() line 356

The 'max_completion_tokens' parameter is only supported in:
- OpenAI API 2024-10-01-preview and later
- Some Azure deployments reject it even with newer API versions

Azure gpt-5 (API version 2025-01-01-preview) was rejecting requests
with this parameter, causing silent failures.

SOLUTION:
Changed back to 'max_tokens' in both methods for broader compatibility:
- Works with all OpenAI API versions
- Works with all Azure OpenAI deployments
- Backward compatible

This fixes gpt-5 so it can now generate responses.

Next issue to address: Line coverage still 0.00% (LLM not including line numbers
despite explicit prompting). Will test if gpt-5 follows instructions better than mini.
PROBLEM:
Got BadRequestError from OpenAI SDK:
"Unsupported parameter: 'max_tokens' is not supported with this model.
Use 'max_completion_tokens' instead."

ROOT CAUSE:
My previous commit (c2205f9) changed max_completion_tokens → max_tokens,
but that was wrong. Newer OpenAI API versions (2024-10-01-preview+)
REQUIRE max_completion_tokens, not max_tokens.

The config uses:
- gpt-4.1-mini: api_version "2025-01-01-preview" → needs max_completion_tokens
- gpt-5: api_version "2025-01-01-preview" → needs max_completion_tokens
- gpt-4.1: api_version "2024-12-01-preview" → needs max_completion_tokens

SOLUTION:
Changed back to max_completion_tokens in:
- _call_openai() line 296
- _call_azure_openai_custom() line 358

This is the correct parameter for:
- OpenAI API 2024-10-01-preview and later
- Azure OpenAI API 2024-10-01-preview and later

Note: Older API versions use max_tokens, but all our deployments use 2024-12+ versions.

Apologies for the confusion - the original merge was correct, my "fix" broke it.
…in synthesis

ROOT CAUSE:
synthesis.py was calling tiered_llm.synthesize_answer() which created its own
generic prompt without line number requirements. The detailed prompt built by
_build_synthesis_prompt() with explicit line number requirements was completely
ignored, causing 0.00% line coverage in validation.

FIX:
Changed synthesis.py to call tiered_llm.generate() directly with the detailed
prompt instead of calling synthesize_answer(). This ensures the prompt with:
- MUST include line number references
- Required format examples
- Explicit requirements for citations

Now reaches the LLM, which should result in narratives with line numbers and
validation passing (line coverage > 0%).

Lines changed: 107-125 in cf/agents/pipelines/synthesis.py
@anamsarfraz anamsarfraz merged commit f27361f into claude/still-disco-011CUzRCZPvjPRrbz1VNy2CY Nov 12, 2025
anamsarfraz added a commit that referenced this pull request Jan 31, 2026
…QsL4Quyw86zC

Claude/check 011 cv33gddu b qs l4 quyw86z c
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.

2 participants