Compare commits

..

1 Commits

Author SHA1 Message Date
Claude
441064b1bf feat: auto-update Dockerfile with current claude-code npm version
- Add GitHub workflow to automatically check for new claude-code versions daily
- Pin CLAUDE_CODE_VERSION to 2.0.55 (instead of 'latest') in Dockerfile and devcontainer.json
- Workflow creates PRs when new versions are available, ensuring Docker cache invalidation

Fixes #582
2025-11-30 04:13:14 +00:00
6 changed files with 64 additions and 169 deletions

View File

@@ -3,7 +3,7 @@ FROM node:20
ARG TZ
ENV TZ="$TZ"
ARG CLAUDE_CODE_VERSION=latest
ARG CLAUDE_CODE_VERSION=2.0.55
# Install basic development tools and iptables/ipset
RUN apt-get update && apt-get install -y --no-install-recommends \

View File

@@ -4,7 +4,7 @@
"dockerfile": "Dockerfile",
"args": {
"TZ": "${localEnv:TZ:America/Los_Angeles}",
"CLAUDE_CODE_VERSION": "latest",
"CLAUDE_CODE_VERSION": "2.0.55",
"GIT_DELTA_VERSION": "0.18.2",
"ZSH_IN_DOCKER_VERSION": "1.2.0"
}

View File

@@ -0,0 +1,62 @@
name: Update DevContainer Claude Code Version
on:
schedule:
# Run daily at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
update-version:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Get latest npm version
id: npm-version
run: |
LATEST_VERSION=$(npm view @anthropic-ai/claude-code version)
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
echo "Latest npm version: $LATEST_VERSION"
- name: Get current version from Dockerfile
id: current-version
run: |
CURRENT_VERSION=$(grep -oP 'ARG CLAUDE_CODE_VERSION=\K[^\s]+' .devcontainer/Dockerfile)
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"
- name: Update version if changed
if: steps.npm-version.outputs.version != steps.current-version.outputs.version
run: |
NEW_VERSION="${{ steps.npm-version.outputs.version }}"
# Update Dockerfile
sed -i "s/ARG CLAUDE_CODE_VERSION=.*/ARG CLAUDE_CODE_VERSION=$NEW_VERSION/" .devcontainer/Dockerfile
# Update devcontainer.json
sed -i "s/\"CLAUDE_CODE_VERSION\": \".*\"/\"CLAUDE_CODE_VERSION\": \"$NEW_VERSION\"/" .devcontainer/devcontainer.json
echo "Updated version to $NEW_VERSION"
- name: Create Pull Request
if: steps.npm-version.outputs.version != steps.current-version.outputs.version
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: update devcontainer claude-code to v${{ steps.npm-version.outputs.version }}"
title: "chore: update devcontainer claude-code to v${{ steps.npm-version.outputs.version }}"
body: |
This PR automatically updates the claude-code version in the devcontainer configuration.
**Changes:**
- Updated `CLAUDE_CODE_VERSION` from `${{ steps.current-version.outputs.version }}` to `${{ steps.npm-version.outputs.version }}`
This ensures Docker cache is invalidated when rebuilding images, allowing users to get the latest claude-code version.
Related: #582
branch: chore/update-claude-code-version
delete-branch: true

View File

@@ -1,77 +0,0 @@
# Opus Fast Model Configuration
## Issue
The "Opus fast" model deployment is currently limited to 200,000 tokens, causing errors like:
```
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 282789 tokens > 200000 maximum"},"request_id":"req_011CVZ3fj1gSV2ZBzHGVnRrA"}
```
## Solution
### Environment Variable Configuration
Claude Code uses environment variables to control model aliases. To configure the fast Opus deployment with extended context length, set the following environment variable:
```bash
# Configure Opus alias to use the fast deployment with extended context
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
### Extended Context Configuration
The fast Opus deployment should support extended context length beyond the default 200k tokens. The recommended configuration:
```bash
# For environments supporting extended context (up to 2M tokens)
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000" # 1M tokens as intermediate step
```
### VSCode Configuration
For VSCode users wanting to use the fast Opus model, add these to your settings or environment:
```json
{
"claude-code.environmentVariables": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast",
"ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000"
}
}
```
### Verification
To verify the configuration is working:
1. Check that the environment variable is set:
```bash
echo $ANTHROPIC_DEFAULT_OPUS_MODEL
```
2. Test with a large context that previously failed (>200k tokens)
3. Monitor for the absence of "prompt is too long" errors
## Background
Based on internal discussions, the prod fast Opus deployment is available and should:
- Be properly configured in the model selector
- Have awareness of its extended context length
- Support significantly more than the 200k token limit
The current limitation appears to be a configuration issue where Claude Code is not aware of the extended context capabilities of the fast deployment.
## Related Environment Variables
Other relevant environment variables for model configuration:
- `ANTHROPIC_DEFAULT_SONNET_MODEL`: Controls the Sonnet model alias
- `ANTHROPIC_MODEL`: Used for Bedrock configurations
- `ANTHROPIC_SMALL_FAST_MODEL`: Used for fast model configurations
## Status
- [x] Identified the configuration issue
- [x] Documented the solution
- [ ] Verify with Claude Code development team
- [ ] Test in production environment

View File

@@ -1,70 +0,0 @@
# Fast Opus 4.5 Model Configuration
## Issue
The standard Opus 4.5 configuration is limited to 200,000 tokens, causing failures with larger contexts.
## Solution: Fast Opus Deployment
### Environment Variable Configuration
To use the fast Opus deployment with extended context length, configure Claude Code with:
```bash
# Set the Opus alias to use the fast deployment
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
### Model String Updates for Fast Deployment
| Platform | Fast Opus 4.5 Model String |
|----------|---------------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` |
| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` |
| Google Vertex AI | `claude-opus-4-5-fast@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101-fast` |
### Context Length Configuration
The fast deployment supports extended context. Configure the context limit:
```bash
# Extended context configuration (up to 1M tokens)
export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000"
```
### Integration with Migration Tool
When migrating to Opus 4.5 with extended context requirements:
1. Use the fast model strings above instead of standard ones
2. Set the environment variable for Opus alias
3. Configure extended context limit
4. Test with large contexts (>200k tokens)
### VSCode Configuration
For VSCode extension users:
```json
{
"claude-code.environmentVariables": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast",
"ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000"
}
}
```
### Verification
Test the configuration with a prompt that exceeds 200k tokens to ensure the error:
```
prompt is too long: 282789 tokens > 200000 maximum
```
is resolved.
## When to Use Fast vs Standard
- **Use Fast**: For large codebases, extensive context analysis, long conversations
- **Use Standard**: For typical development tasks with smaller context requirements
The fast deployment trades some response speed for much higher context capacity.

View File

@@ -30,8 +30,6 @@ Remove the `context-1m-2025-08-07` beta header if present—it is not yet suppor
### Target Model Strings (Opus 4.5)
#### Standard Opus 4.5 (200k context limit)
| Platform | Opus 4.5 Model String |
|----------|----------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101` |
@@ -39,24 +37,6 @@ Remove the `context-1m-2025-08-07` beta header if present—it is not yet suppor
| Google Vertex AI | `claude-opus-4-5@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101` |
#### Fast Opus 4.5 (Extended context)
For applications requiring >200k tokens, use the fast deployment:
| Platform | Fast Opus 4.5 Model String |
|----------|---------------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` |
| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` |
| Google Vertex AI | `claude-opus-4-5-fast@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101-fast` |
To configure Claude Code to use the fast deployment, set:
```bash
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
**Note**: See `FAST_MODEL_CONFIG.md` for complete configuration details.
### Source Model Strings to Replace
| Source Model | Anthropic API (1P) | AWS Bedrock | Google Vertex AI |