Skip to content
Open
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
8 changes: 7 additions & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: Copilot
allowed_non_write_users: "Copilot,claude[bot]"
allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
Comment on lines +72 to 73
trigger_phrase: "@claude"
assignee_trigger: claude[bot]
Expand Down Expand Up @@ -105,6 +105,8 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: "Copilot,claude[bot]"
allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
Expand Down Expand Up @@ -140,6 +142,8 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: "Copilot,claude[bot]"
allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
Expand Down Expand Up @@ -177,6 +181,8 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: "Copilot,claude[bot]"
allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
Expand Down
212 changes: 212 additions & 0 deletions .github/workflows/claude.yml.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# SPDX-FileCopyrightText: 2025 Knitli Inc.
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
#
# SPDX-License-Identifier: MIT OR Apache-2.0

name: Claude Assistant
on:
issue_comment:
types:
- created
pull_request_review_comment:
types:
- created
issues:
types:
- opened
- assigned
- labeled
pull_request_review:
types:
- submitted

permissions:
actions: read
checks: read
contents: write
discussions: read
id-token: write
issues: write
pull-requests: write

env:
CODEWEAVER_VECTOR_STORE_URL: ${{ secrets.CODEWEAVER_VECTOR_STORE_URL }}
QDRANT__SERVICE__API_KEY: ${{ secrets.QDRANT__SERVICE__API_KEY }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
CODEWEAVER_PROJECT_PATH: ${{ github.workspace }}
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MISE_ENV: "dev"
MISE_YES: 1
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
# Limit CodeQL memory usage to prevent OOM kills on standard runners (7GB total RAM)
# Note: Standard runners have ~7GB, so limit to 3GB to leave headroom for system
CODEQL_RAM: 3072
CODEQL_THREADS: 2
# Additional limits for CodeQL extractor and evaluator
CODEQL_EXTRACTOR_PYTHON_RAM: 2048
CODEQL_EVALUATOR_RAM: 2048
jobs:
claude-response:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 2
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Environment for Review
if: github.event_name == 'pull_request_review'
uses: ./.github/actions/setup-mise-env
with:
python-version: "3.13"
github-token: ${{ secrets.GITHUB_TOKEN }}
profile: reviewer
skip-checkout: "true"

- name: PR Review
if: github.event_name == 'pull_request_review'
uses: anthropics/claude-code-action@e8bad572273ce919ba15fec95aef0ce974464753
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_non_write_users: "*"
allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude[bot]
label_trigger: claude
base_branch: main
use_commit_signing: true
claude_args: |
--max-turns 100
--allowedTools Bash,TaskOutput,Batch,Glob,Grep,MCPSearch,Read,Skill,TaskCreate,TaskGet,TaskList,TaskUpdate,WebFetch,WebSearch,mcp__context7__get-library-docs,mcp__context7__resolve-library-id,mcp__sequential-thinking__sequentialthinking,mcp__github_ci__get_workflow_run_details,mcp__codeweaver__find_code,mcp__tavily__tavily_search,
--mcp-config .mcp.json
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Please review this pull request and identify:
- bugs
- security issues and potential vulnerabilities
- performance issues
If you identify issues, briefly describe them. Provide a recommended fix with example implementation.

Keep your feedback focused, actionable, and concise.
- name: Setup Environment for Issues
if: github.event_name == 'issues' || github.event.action == 'opened'
uses: ./.github/actions/setup-mise-env
with:
python-version: "3.13"
github-token: ${{ secrets.GITHUB_TOKEN }}
profile: dev
skip-checkout: "true"
- name: Issue Opened
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: anthropics/claude-code-action@e8bad572273ce919ba15fec95aef0ce974464753
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
track_progress: true
use_commit_signing: true
base_branch: main
claude_args: |
--max-turns 100
--allowedTools Bash,TaskOutput,Edit,Glob,Grep,KillShell,MCPSearch,Read,Skill,Agent,TaskCreate,TaskGet,TaskList,TaskUpdate,WebFetch,WebSearch,Write,mcp__context7__get-library-docs,mcp__context7__resolve-library-id,mcp__sequential-thinking__sequentialthinking,mcp__github_ci__get_workflow_run_details,mcp__codeweaver__find_code,WebFetch,WebSearch,mcp__tavily__tavily_search
--mcp-config .mcp.json
prompt: |
REPO: ${{ github.repository }}
ISSUE NUMBER: ${{ github.event.issue.number }}
When a new issue is opened:
- Review and summarize the issue.
- Include any relevant context or background.
- Look for related issues or discussions and link to them.
- Assign relevant labels, or if you can't assign them, suggest them.
- If the issue covers the same topic as an existing open or closed issue, recommend closing the issue and linking to the relevant PR or issue.
- Identify potential fixes and briefly describe them with links to relevant code.
- If it's a feature request, estimate the difficulty of implementing the feature and potential impact on existing functionality and API.
- name: Setup Environment for PR Review Comments
if: github.event_name == 'pull_request_review_comment'
uses: ./.github/actions/setup-mise-env
with:
python-version: "3.13"
github-token: ${{ secrets.GITHUB_TOKEN }}
profile: minimal
skip-checkout: "true"
- name: PR Review Comment
if: github.event_name == 'pull_request_review_comment'
uses: anthropics/claude-code-action@e8bad572273ce919ba15fec95aef0ce974464753
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
use_commit_signing: true
base_branch: main
claude_args: |
--max-turns 50
--allowedTools Bash,TaskOutput,Glob,Grep,KillShell,MCPSearch,Read,Skill,Agent,TaskCreate,TaskGet,TaskList,TaskUpdate,WebFetch,WebSearch,mcp__context7__get-library-docs,mcp__context7__resolve-library-id,mcp__sequential-thinking__sequentialthinking,mcp__github_ci__get_workflow_run_details,mcp__codeweaver__find_code,mcp__tavily__tavily_search,WebFetch,WebSearch
--mcp-config .mcp.json
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
COMMENT ID: ${{ github.event.comment.id }}
When you are asked to review a pull request:
- Review the changes made in the PR.
- Provide feedback on the code quality, functionality, and adherence to best practices.
- Consider the library's existing code style and whether the code aligns with it.
- Consider possible security or performance effects.
- If the code does not follow APIs as you would expect, remember that you have access to the context7 tool to look up library documentation. APIs may have changed since your training data.
- Suggest improvements or alternatives where applicable.
- If the changes are satisfactory and the code passes checks, approve the PR with a comment.
- name: Setup Environment for Assigned or Labeled Issues/PRs
if: |
(github.event_name == 'issues' && github.event.action == 'assigned') || (github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'claude') || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'claude')
uses: ./.github/actions/setup-mise-env
with:
python-version: "3.13"
github-token: ${{ secrets.GITHUB_TOKEN }}
profile: dev
skip-checkout: "true"
- name: Issue Assigned or Labeled Claude
if: |
((github.event_name == 'issues' && github.event.action == 'assigned') || (github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'claude') || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'claude')) && (github.event.label.name != 'upstream-sync')
uses: anthropics/claude-code-action@e8bad572273ce919ba15fec95aef0ce974464753
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
track_progress: true
use_commit_signing: true
base_branch: main
claude_args: |
--max-turns 200
--allowedTools Bash,TaskOutput,Edit,ExitPlanMode,Glob,Grep,KillShell,MCPSearch,Read,Skill,Agent,TaskCreate,TaskGet,TaskList,TaskUpdate,WebFetch,WebSearch,Write,mcp__context7__get-library-docs,mcp__context7__resolve-library-id,mcp__sequential-thinking__sequentialthinking,mcp__github_ci__get_workflow_run_details,mcp__codeweaver__find_code,WebFetch,WebSearch
--mcp-config .mcp.json
prompt: |
REPO: ${{ github.repository }}
ISSUE/PR NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
When you are assigned an issue or it's labeled 'claude':
- Your job is to resolve it.
- Gather all necessary information about the issue from discussions and comments and the codebase.
- If the issue involves external libraries, use the context7 tool to get the latest information on the API.
- Pay attention to external API versions--they may have changed since your training data, or even since the sources you research. When in doubt, use the tavily tool or web search to find the current documentation.
- Research similar issues in this repository and others to inform your approach.
- Communicate with the issue reporter for clarification if needed.
- Create an issue branch.
- Develop a detailed plan to fix the problem.
- Write your plan and information from your research to a markdown file. Continually refer to this as you work.
- Use the sequential-thinking tool to plan your actions.
- Implement the fix and test it thoroughly.
- If the fix might affect core functionality, update or add tests focused on that functionality.
- Run all pre-commit lint checks and ensure everything is formatted correctly ('hk check', 'hk fix').
- Use conventional commits format.
- Copy your planning file into your PR and then delete it before submitting.
- Submit your changes in a pull request:
- Document your changes and the reasoning behind them.
- Provide your markdown file with the plan and research information.
- Submit your solution for review.
29 changes: 29 additions & 0 deletions patch_claude.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- .github/workflows/claude.yml
+++ .github/workflows/claude.yml
@@ -106,6 +106,8 @@
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
+ allowed_non_write_users: "*"
+ allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
@@ -141,6 +143,8 @@
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
+ allowed_non_write_users: "*"
+ allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
@@ -178,6 +182,8 @@
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
+ allowed_non_write_users: "*"
+ allowed_bots: "github-actions[bot],copilot[bot],dependabot[bot],copilot,github-actions,gemini[bot],claude[bot]"
trigger_phrase: "@claude"
assignee_trigger: claude
label_trigger: claude
11 changes: 11 additions & 0 deletions patch_config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/codeweaver/cli/commands/config.py
+++ src/codeweaver/cli/commands/config.py
@@ -103,7 +103,7 @@
table.add_row("Project Path", str(settings["project_path"]))
table.add_row("Project Name", settings["project_name"] or "auto-detected")
table.add_row("Token Limit", str(settings["token_limit"]))
- table.add_row("Max File Size", f"{settings['max_file_size']:,} bytes")
+ table.add_row("Max File Size", f"{settings.get('max_file_size', 0):,} bytes")
table.add_row("Max Results", str(settings["max_results"]))

# Feature flags
16 changes: 16 additions & 0 deletions patch_config2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- src/codeweaver/cli/commands/config.py
+++ src/codeweaver/cli/commands/config.py
@@ -108,12 +108,12 @@
table.add_row(
"Background Indexing",
"❌"
- if settings["indexer"].get("only_index_on_command")
- and not isinstance(settings["indexer"].get("only_index_on_command"), Unset)
+ if settings.get("indexer") and settings["indexer"].get("only_index_on_command")
+ and not isinstance(settings.get("indexer", {}).get("only_index_on_command"), Unset)
else "βœ…",
)
- table.add_row("Telemetry", "❌" if settings["telemetry"].get("disable_telemetry") else "βœ…")
+ table.add_row("Telemetry", "❌" if settings.get("telemetry") and settings["telemetry"].get("disable_telemetry") else "βœ…")

display.print_table(table)
18 changes: 18 additions & 0 deletions patch_voyage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- src/codeweaver/providers/reranking/providers/voyage.py
+++ src/codeweaver/providers/reranking/providers/voyage.py
@@ -28,8 +28,11 @@
logger = logging.getLogger(__name__)

try:
- from voyageai.client_async import AsyncClient
- from voyageai.object.reranking import RerankingObject
- from voyageai.object.reranking import RerankingResult as VoyageRerankingResult
+ try:
+ from voyageai.client_async import AsyncClient
+ from voyageai.object.reranking import RerankingObject
+ from voyageai.object.reranking import RerankingResult as VoyageRerankingResult
+ except Exception:
+ AsyncClient, RerankingObject, VoyageRerankingResult = object, object, object

except ImportError as e:
from codeweaver.core import ConfigurationError
18 changes: 18 additions & 0 deletions patch_voyage2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- src/codeweaver/providers/embedding/providers/voyage.py
+++ src/codeweaver/providers/embedding/providers/voyage.py
@@ -15,9 +15,12 @@
logger = logging.getLogger(__name__)

try:
- from voyageai.client_async import AsyncClient
- from voyageai.object.contextualized_embeddings import ContextualizedEmbeddingsObject
- from voyageai.object.embeddings import EmbeddingsObject
+ try:
+ from voyageai.client_async import AsyncClient
+ from voyageai.object.contextualized_embeddings import ContextualizedEmbeddingsObject
+ from voyageai.object.embeddings import EmbeddingsObject
+ except Exception:
+ AsyncClient, ContextualizedEmbeddingsObject, EmbeddingsObject = object, object, object
except ImportError as _import_error:
raise ConfigurationError(
'Please install the `voyageai` package to use the Voyage provider, you can use the `voyage` optional group -- `pip install "code-weaver\\[voyage]"`'
8 changes: 4 additions & 4 deletions src/codeweaver/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ def _show_config(settings: DictView[CodeWeaverSettingsDict]) -> None:
table.add_row("Project Path", str(settings["project_path"]))
table.add_row("Project Name", settings["project_name"] or "auto-detected")
table.add_row("Token Limit", str(settings["token_limit"]))
table.add_row("Max File Size", f"{settings['max_file_size']:,} bytes")
table.add_row("Max File Size", f"{settings.get('max_file_size', 0):,} bytes")
table.add_row("Max Results", str(settings["max_results"]))

# Feature flags
table.add_row(
"Background Indexing",
"❌"
if settings["indexer"].get("only_index_on_command")
and not isinstance(settings["indexer"].get("only_index_on_command"), Unset)
if settings.get("indexer") and settings["indexer"].get("only_index_on_command")
and not isinstance(settings.get("indexer", {}).get("only_index_on_command"), Unset)
else "βœ…",
)
table.add_row("Telemetry", "❌" if settings["telemetry"].get("disable_telemetry") else "βœ…")
table.add_row("Telemetry", "❌" if settings.get("telemetry") and settings["telemetry"].get("disable_telemetry") else "βœ…")
Comment on lines +111 to +115
Comment on lines +111 to +115

display.print_table(table)

Expand Down
Loading
Loading