Skip to content

Fix AI summary model/base-url config and thinking-block parsing - #26

Merged
normanajn merged 1 commit into
mainfrom
feature/widen-entry-form
Aug 3, 2026
Merged

normanajn merged 1 commit into
mainfrom
feature/widen-entry-form

Conversation

@normanajn

Copy link
Copy Markdown
Collaborator

Summary

  • ai_summary.py read settings.ANTHROPIC_MODEL, which doesn't exist (the setting is ANTHROPIC_SUMMARY_MODEL), so model overrides from env/.env/Helm values were silently ignored everywhere
  • Wire ANTHROPIC_BASE_URL into the helm/compose chart (helm/simple already had it), document it in .env.example, and add matching --anthropic-model/--anthropic-base-url flags to start-scd-reporting
  • Fix response parsing to skip ThinkingBlock content when extended thinking is enabled by the model/proxy

Test plan

  • Ran generate() against real WorkItem data via manage.py shell with the new API key/model/base-url — returns a proper summary instead of 'ThinkingBlock' object has no attribute 'text'
  • helm template on both helm/compose and helm/simple renders ANTHROPIC_BASE_URL correctly
  • Restarted local dev server and confirmed settings.ANTHROPIC_SUMMARY_MODEL/ANTHROPIC_BASE_URL resolve from .env

🤖 Generated with Claude Code

ai_summary.py read settings.ANTHROPIC_MODEL, which doesn't exist (the
setting is ANTHROPIC_SUMMARY_MODEL), so model overrides from env/.env/
Helm values were silently ignored everywhere. Also wire ANTHROPIC_BASE_URL
into the helm/compose chart (helm/simple already had it), document it in
.env.example, add matching --anthropic-model/--anthropic-base-url flags
to start-scd-reporting, and fix response parsing to skip ThinkingBlock
content when extended thinking is enabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 3, 2026 21:09
@normanajn
normanajn merged commit ec3e170 into main Aug 3, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes configuration wiring and response parsing for the AI Summary feature so that model/base URL overrides are actually honored and “extended thinking” responses don’t break summary generation.

Changes:

  • Read settings.ANTHROPIC_SUMMARY_MODEL / settings.ANTHROPIC_BASE_URL and skip non-text content blocks (e.g., ThinkingBlock) when assembling summaries.
  • Wire ANTHROPIC_BASE_URL through the helm/compose chart and document it in .env.example.
  • Add --anthropic-model / --anthropic-base-url flags to start-scd-reporting and export matching env vars.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/start-scd-reporting Adds CLI flags and exports for Anthropic model/base URL to control AI Summary runtime config.
helm/compose/values.yaml Introduces anthropic.baseUrl value for compose chart configuration.
helm/compose/templates/configmap.yaml Exposes ANTHROPIC_BASE_URL via ConfigMap env var.
apps/reports/ai_summary.py Uses the correct settings fields and parses only text blocks from the Anthropic response.
.env.example Documents ANTHROPIC_BASE_URL usage for proxy routing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +230 to +234
#
# AI Settings
export ANTHROPIC_API_KEY="$ANTHROPIC_KEY"
export ANTHROPIC_BASE_URL="$ANTHROPIC_BASE_URL"
export ANTHROPIC_SUMMARY_MODEL="$ANTHROPIC_SUMMARY_MODEL"
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