Repository navigation
Closed
Description
Previous Issue ID
33
Epic
Enable Model-Specific AI Processing via Issue Labels
Current Stage
The worker can now handle model names. This critical task focuses on making claudeService.js actually use the specified model when invoking the claude-code CLI.
Description
The claudeService.js module executes the claude-code CLI in Docker. It currently doesn't explicitly select an Anthropic model. This issue requires:
- Investigating how
claude-codeCLI can be instructed to use a specific model (e.g.,claude-3-opus-20240229). - Modifying
executeClaudeCodeinsrc/claude/claudeService.jsto pass themodelNamefrom the worker to the Dockerized CLI execution.
Context
executeClaudeCodeinsrc/claude/claudeService.jsruns a Docker command.- The provided
claude --helpoutput lacks a direct model selection flag. - Config files (
~/.claude/.credentials.json,~/.claude.json) are mounted.
Implementation Steps
- Research
claude-codeCLI Model Selection:- Investigate if model selection is possible via: CLI argument (undocumented?), environment variable, or config file modification.
- Modify
executeClaudeCode(src/claude/claudeService.js):- Add a
modelToUseparameter. - Implement logic to pass
modelToUsetoclaude-codebased on research (e.g., Docker env var, dynamic config mount).
- Add a
- Handle Infeasibility:
- If direct model selection is impossible, document this. The
modelNamewill then be for tracking/labeling, and PRs might use the defaultclaude-codemodel.
- If direct model selection is impossible, document this. The
- Update Claude Prompt (Optional):
- Consider adding model name to the prompt (e.g.,
You are to act as ${modelToUse}).
- Consider adding model name to the prompt (e.g.,
- Testing:
- Update
test/claude.test.js. Focus on correct parameter passing. Manual testing will be crucial.
- Update
Suggested Implementation (Conceptual - src/claude/claudeService.js)
export async function executeClaudeCode({ /*...,*/ modelToUse }) {
logger.info({ /*...,*/ modelToUse }, /*...*/);
const prompt = customPrompt || generateClaudePrompt(issueRef, modelToUse);
const dockerArgs = [ /*...*/ ];
// *** CRITICAL INVESTIGATION AREA for model selection mechanism ***
// Option A: Docker Env Var: dockerArgs.push('-e', `CLAUDE_MODEL_OVERRIDE=${modelToUse}`); (hypothetical)
// Option B: CLI Arg: dockerArgs.push('--use-model', modelToUse); (hypothetical)
// Option C: Dynamic Config File
// *** END CRITICAL INVESTIGATION AREA ***
dockerArgs.push(CLAUDE_DOCKER_IMAGE, 'claude', '-p', prompt, /*...*/);
// ...
// Log if actual model used (from claude-code output) matches intended modelToUse
}
function generateClaudePrompt(issueRef, modelName) {
return `Please analyze and fix the GitHub issue: #${issueRef.number}. You are acting as model: ${modelName || 'default'}. ...`;
}Metadata
Metadata
Assignees
Labels
No labels
Activity
integry commentedon May 28, 2025
Suggested conceptual implementation for
src/claude/claudeService.js:Reasoning for Issue 3 code:
The
executeClaudeCodefunction now accepts amodelToUseparameter. The core of this task is the critical investigation area commented in the code. This is where the developer must determine how (or if) theclaude-codeCLI can be instructed to use a specific model. The code shows placeholders for potential mechanisms (environment variable, CLI argument, or dynamic config). If a mechanism is found, it should be implemented there. The prompt generation is also updated to optionally include the model name to potentially influence Claude's behavior. Finally, logging is added to compare theintendedModelwith the model actually reported by theclaude-codetool's output, which is crucial if direct control isn't possible.integry commentedon May 29, 2025
already implemented