Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/agents-71-codex-belt-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Mint GitHub App token (preferred)
id: app_token
if: ${{ env.WORKFLOWS_APP_ID != '' && env.WORKFLOWS_APP_PRIVATE_KEY != '' }}
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ env.WORKFLOWS_APP_ID }}
private-key: ${{ env.WORKFLOWS_APP_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-72-codex-belt-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Mint GitHub App token (preferred)
id: app_token
if: ${{ env.WORKFLOWS_APP_ID != '' && env.WORKFLOWS_APP_PRIVATE_KEY != '' }}
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ env.WORKFLOWS_APP_ID }}
private-key: ${{ env.WORKFLOWS_APP_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-73-codex-belt-conveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Mint GitHub App token (preferred)
id: app_token
if: ${{ env.WORKFLOWS_APP_ID != '' && env.WORKFLOWS_APP_PRIVATE_KEY != '' }}
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ env.WORKFLOWS_APP_ID }}
private-key: ${{ env.WORKFLOWS_APP_PRIVATE_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/agents-auto-pilot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:

- name: Set up Node
if: steps.check_enabled.outputs.enabled == 'true'
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '20'

Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:

- name: Cache pip (LLM requirements)
if: steps.check_enabled.outputs.enabled == 'true'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: |
~/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-autofix-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- name: Mint GitHub App token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/agents-autofix-loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down Expand Up @@ -648,7 +648,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down Expand Up @@ -737,7 +737,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-issue-optimizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
id: app_token
if: steps.check.outputs.should_run == 'true'
continue-on-error: true
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID }}
private-key: ${{ secrets.WORKFLOWS_APP_PRIVATE_KEY }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/agents-keepalive-loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 20

Expand Down Expand Up @@ -492,7 +492,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 20

Expand Down Expand Up @@ -614,7 +614,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: 20

Expand Down Expand Up @@ -1132,7 +1132,7 @@ jobs:
steps.update-summary.outputs.rate_limit_hit == 'true' &&
env.KEEPALIVE_APP_ID != '' &&
env.KEEPALIVE_APP_PRIVATE_KEY != ''
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
env:
KEEPALIVE_APP_ID: ${{ secrets.KEEPALIVE_APP_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agents-weekly-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maint-76-claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
- name: Run Claude Code Review
id: claude
continue-on-error: true
uses: anthropics/claude-code-action@ff9acae5886d41a99ed4ec14b7dc147d55834722
uses: anthropics/claude-code-action@220272d38887a1caed373da96a9ffdb0919c26cc
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: '*'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/maint-coverage-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
# Mint GitHub App token early to use for API calls (avoids rate limits)
- name: Mint GitHub App Token
id: app_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
continue-on-error: true
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID || '0' }}
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:

- name: Download coverage trend artifact
if: ${{ steps.discover.outputs.run_id }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
continue-on-error: true
with:
name: gate-coverage-trend
Expand All @@ -196,7 +196,7 @@ jobs:

- name: Download coverage payload artifact
if: ${{ steps.discover.outputs.run_id }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
continue-on-error: true
with:
name: gate-coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-pr-context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
id: app_token
# Use continue-on-error to handle missing secrets gracefully
continue-on-error: true
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v2
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ secrets.WORKFLOWS_APP_ID }}
private-key: ${{ secrets.WORKFLOWS_APP_PRIVATE_KEY }}
Expand Down
45 changes: 18 additions & 27 deletions tools/langchain_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Any, cast

from tools.llm_provider import DEFAULT_MODEL, GITHUB_MODELS_BASE_URL

Expand All @@ -34,14 +33,6 @@
DEFAULT_SLOT_CONFIG_PATH = Path(__file__).resolve().parent.parent / "config" / "llm_slots.json"


def _load_chat_anthropic() -> type[Any] | None:
try:
from langchain_anthropic import ChatAnthropic
except ImportError:
return None
return cast(type[Any], ChatAnthropic)


def _env_int(name: str, default: int) -> int:
value = os.environ.get(name)
if not value:
Expand Down Expand Up @@ -225,7 +216,10 @@ def build_chat_client(
except ImportError:
return None

chat_anthropic = _load_chat_anthropic()
try:
from langchain_anthropic import ChatAnthropic
except ImportError:
ChatAnthropic = None # noqa: N806

github_token = os.environ.get("GITHUB_TOKEN")
openai_token = os.environ.get("OPENAI_API_KEY")
Expand Down Expand Up @@ -272,11 +266,11 @@ def build_chat_client(
return None

if selected_provider == PROVIDER_ANTHROPIC:
if not anthropic_token or chat_anthropic is None:
if not anthropic_token or not ChatAnthropic:
return None
try:
client = _build_anthropic_client(
chat_anthropic,
ChatAnthropic,
model=selected_model,
token=anthropic_token,
timeout=selected_timeout,
Expand All @@ -303,10 +297,10 @@ def build_chat_client(
)
used_override = True
return ClientInfo(client=client, provider=PROVIDER_OPENAI, model=slot_model)
if slot.provider == PROVIDER_ANTHROPIC and anthropic_token and chat_anthropic is not None:
if slot.provider == PROVIDER_ANTHROPIC and anthropic_token and ChatAnthropic:
with contextlib.suppress(Exception):
client = _build_anthropic_client(
chat_anthropic,
ChatAnthropic,
model=slot_model,
token=anthropic_token,
timeout=selected_timeout,
Expand Down Expand Up @@ -342,7 +336,10 @@ def build_chat_clients(
except ImportError:
return []

chat_anthropic = _load_chat_anthropic()
try:
from langchain_anthropic import ChatAnthropic
except ImportError:
ChatAnthropic = None # noqa: N806

github_token = os.environ.get("GITHUB_TOKEN")
openai_token = os.environ.get("OPENAI_API_KEY")
Expand Down Expand Up @@ -423,16 +420,12 @@ def build_chat_clients(
model=second_model,
)
)
elif (
selected_provider == PROVIDER_ANTHROPIC
and anthropic_token
and chat_anthropic is not None
):
elif selected_provider == PROVIDER_ANTHROPIC and anthropic_token and ChatAnthropic:
with contextlib.suppress(Exception):
clients.append(
ClientInfo(
client=_build_anthropic_client(
chat_anthropic,
ChatAnthropic,
model=first_model,
token=anthropic_token,
timeout=selected_timeout,
Expand All @@ -447,7 +440,7 @@ def build_chat_clients(
clients.append(
ClientInfo(
client=_build_anthropic_client(
chat_anthropic,
ChatAnthropic,
model=second_model,
token=anthropic_token,
timeout=selected_timeout,
Expand All @@ -466,9 +459,7 @@ def build_chat_clients(
if any(
(
slot.provider == PROVIDER_OPENAI and openai_token,
slot.provider == PROVIDER_ANTHROPIC
and anthropic_token
and chat_anthropic is not None,
slot.provider == PROVIDER_ANTHROPIC and anthropic_token and ChatAnthropic,
slot.provider == PROVIDER_GITHUB and github_token,
)
):
Expand Down Expand Up @@ -497,12 +488,12 @@ def build_chat_clients(
model=slot_model,
)
)
if slot.provider == PROVIDER_ANTHROPIC and anthropic_token and chat_anthropic is not None:
if slot.provider == PROVIDER_ANTHROPIC and anthropic_token and ChatAnthropic:
with contextlib.suppress(Exception):
clients.append(
ClientInfo(
client=_build_anthropic_client(
chat_anthropic,
ChatAnthropic,
model=slot_model,
token=anthropic_token,
timeout=selected_timeout,
Expand Down
6 changes: 3 additions & 3 deletions tools/requirements-llm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# workflow automation can upgrade independently; no consumer dependency
# change is required when bumping this file.
# - Use strict X.Y.Z pins to keep workflow installs reproducible.
langchain==1.2.13
langchain==1.2.10
langchain-core==1.2.20
langchain-community==0.4.1
langchain-openai==1.1.11
langchain-anthropic==1.4.0
langchain-openai==1.1.10
langchain-anthropic==1.3.4
pydantic==2.12.5
requests==2.32.5
Loading