Skip to content

chore: sync workflow templates - #847

Merged
stranske merged 1 commit into
mainfrom
sync/workflows-c11e0664a4d8
Jun 22, 2026
Merged

chore: sync workflow templates#847
stranske merged 1 commit into
mainfrom
sync/workflows-c11e0664a4d8

Conversation

@stranske

@stranske stranske commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Sync Summary

Files Updated

  • progress_reviewer.py: Progress reviewer - evaluates agent progress for keepalive rounds
  • llm_provider.py: LLM provider configuration - GitHub Models and OpenAI client setup

Files Skipped

  • renovate.json: File exists and sync_mode is create_only
  • cross-repo-smoke.yml: File exists and sync_mode is create_only
  • llm_slots.json: None

Review Checklist

  • CI passes with updated workflows
  • No repo-specific customizations were overwritten

Source: stranske/Workflows
Source SHA: f4fa43827665268e99f8c9759a1e3f80aead3131
Template hash: c11e0664a4d8
Sync branch: sync/workflows-c11e0664a4d8
Consumer repo: stranske/Template
Manifest: .github/sync-manifest.yml

Summary by CodeRabbit

  • New Features

    • Added support for externally configured language models in analysis operations.
  • Refactoring

    • Improved language model client construction with centralized module architecture and enhanced fallback support for increased reliability and flexibility.

Automated sync from stranske/Workflows
Template hash: c11e0664a4d8

Changes synced from sync-manifest.yml
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5ce21923-aef3-4c47-8fb8-58dce4c9c9a0

📥 Commits

Reviewing files that changed from the base of the PR and between 89d68b1 and e4dc467.

📒 Files selected for processing (2)
  • scripts/langchain/progress_reviewer.py
  • tools/llm_provider.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • stranske/Workflows (auto-detected)
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

In Manager-Database repository using Prefect 2.x, import schedules from prefect.client.schemas.schedules rather than other locations

Files:

  • scripts/langchain/progress_reviewer.py
  • tools/llm_provider.py
🔀 Multi-repo context stranske/Workflows

Perfect. I now have the complete picture. Let me provide the final comprehensive analysis:

Linked repositories findings

stranske/Workflows (Source Repository) - Complete Analysis

1. Import and Delegation Chain [::stranske/Workflows::]

scripts/langchain/_llm_client.py (lines 63-73) provides the shared client builder:

def build_client(
    *,
    model: str | None = None,
    provider: str | None = None,
    force_openai: bool = False,
) -> Any | None:
    try:
        from tools.langchain_client import build_chat_client
    except ImportError:
        return None
    return build_chat_client(model=model, provider=provider, force_openai=force_openai)

2. Provider Implementations Using New Wiring [::stranske/Workflows::]

tools/llm_provider.py:

OpenAIProvider._get_client() (lines 595-610):

  • Calls _configured_langchain_model("openai", fallback=DEFAULT_OPENAI_ANALYSIS_MODEL)
  • Imports and invokes: build_chat_client(provider="openai", model=model_name)
  • Stores the resolved model: self._model_name = resolved.model
  • Returns resolved.client

AnthropicProvider._get_client() (lines 667-685):

  • Same pattern: resolves model, calls build_chat_client(provider="anthropic", model=model_name)
  • Stores resolved model: self._model_name = resolved.model

CompletionAnalysis Construction (lines 643, 727):

  • Uses getattr(self, "_model_name", fallback_default) instead of hardcoded model names
  • Test verification: tests/tools/test_llm_provider.py confirms model name propagation from build_chat_client returns

3. Progress Reviewer Integration [::stranske/Workflows::]

scripts/langchain/progress_reviewer.py (lines 429-434):

try:
    from scripts.langchain._llm_client import build_client
except ImportError:
    build_client = None

resolved = build_client(model=model) if build_client else None
  • Uses the new scripts.langchain._llm_client.build_client entry point
  • Gracefully degrades if module unavailable (non-breaking fallback to heuristics)

4. Model Registry Dependency [::stranske/Workflows::]

tools/llm_provider.py (lines 49-51):

def _configured_langchain_model(provider: str, *, fallback: str) -> str:
    try:
        from tools.llm_registry import configured_model_for_provider
    except ImportError:
        return fallback
    return configured_model_for_provider(provider, fallback=fallback) or fallback
  • Depends on tools.llm_registry.configured_model_for_provider(provider, fallback=...)
  • Returns fallback if import fails (non-breaking)

5. API Contract Verification from Tests [::stranske/Workflows::]

Test cases (tests/tools/test_llm_provider.py) explicitly verify:

  • build_chat_client(provider="openai", model="gpt-configured") called correctly
  • configured_model_for_provider("openai", fallback="gpt-5.4") called correctly
  • Resolved model from ClientInfo propagates to CompletionAnalysis.model_name

Critical Observations for Cross-Repo Sync:

  1. The synced files depend on three other modules not being synced in this PR:

    • tools/langchain_client.build_chat_client (signature with model, provider, force_openai params)
    • tools/llm_registry.configured_model_for_provider (signature with provider, fallback params)
    • scripts/langchain/_llm_client.py in its entirety
  2. Related PR #841 mentioned in context likely modifies tools/langchain_client.build_chat_client — if the consumer repository hasn't synced that change yet, there could be API mismatches.

  3. Fallback handling is in place — both progress_reviewer.py and llm_provider.py use try/except for imports, so they degrade gracefully if dependencies are missing.

  4. Test coverage confirms the integration works — the source repository has passing tests that validate the new wiring, indicating the APIs are stable in the source.

🔇 Additional comments (2)
tools/llm_provider.py (1)

43-52: LGTM!

Also applies to: 598-608, 640-644, 669-681, 723-729, 980-981, 1008-1009

scripts/langchain/progress_reviewer.py (1)

430-434: LGTM!


📝 Walkthrough

Walkthrough

tools/llm_provider.py adds two default model constants and a _configured_langchain_model() helper that resolves provider models via llm_registry. OpenAIProvider and AnthropicProvider delegate LangChain client construction to build_chat_client and derive CompletionAnalysis.model_name dynamically. scripts/langchain/progress_reviewer.py switches its client factory import to scripts.langchain._llm_client.build_client.

Changes

LLM Provider Client Centralization

Layer / File(s) Summary
Default model constants and resolution helper
tools/llm_provider.py
Adds DEFAULT_OPENAI_ANALYSIS_MODEL = "gpt-5.4" and DEFAULT_ANTHROPIC_ANALYSIS_MODEL = "claude-sonnet-4-6" constants plus a private _configured_langchain_model() helper that resolves a provider model via tools.llm_registry.configured_model_for_provider with fallback to those defaults.
OpenAI and Anthropic provider client and model-name wiring
tools/llm_provider.py
Refactors OpenAIProvider._get_client() and AnthropicProvider._get_client() to call tools.langchain_client.build_chat_client using _configured_langchain_model() instead of directly constructing ChatOpenAI/ChatAnthropic; caches resolved model in self._model_name. Both providers' analyze_completion() now derive CompletionAnalysis.model_name from self._model_name or the configured fallback.
Docstring updates and progress_reviewer factory switch
tools/llm_provider.py, scripts/langchain/progress_reviewer.py
Updates get_llm_provider() docstring and provider-chain comments to reference "configured slot models" instead of fixed IDs. Switches review_progress_with_llm to import scripts.langchain._llm_client.build_client with the existing ImportError-to-None fallback pattern.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • stranske/Template#841: Refactors tools/langchain_client.build_chat_client and tools/llm_registry slot-model resolution that _configured_langchain_model() and the refactored _get_client() methods in this PR directly depend on.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'chore: sync workflow templates' is vague and misleading. The actual changes involve updating LLM provider wiring and progress reviewer imports with new model constants and client construction logic, not syncing workflow templates. Update the title to reflect the actual changes, such as 'chore: update LLM provider and progress reviewer for configured slot models' or similar to accurately describe the code modifications.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/workflows-c11e0664a4d8

Comment @coderabbitai help to get the list of available commands and usage tips.

@stranske-keepalive

stranske-keepalive Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: a8d0a22
Latest Runs: ⏳ pending — Gate
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 100.00%
Baseline 0.00%
Delta +100.00%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/my_project/__init__.py 100.0% 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske temporarily deployed to agent-standard June 22, 2026 12:02 — with GitHub Actions Inactive
@stranske
stranske merged commit 2c11aec into main Jun 22, 2026
93 of 106 checks passed
@stranske
stranske deleted the sync/workflows-c11e0664a4d8 branch June 22, 2026 12:48
@coderabbitai coderabbitai Bot mentioned this pull request Jun 22, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Automated sync from Workflows sync Automated sync from Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant