Skip to content
Merged
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
13 changes: 12 additions & 1 deletion containers/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ RUN wget -q "https://github.com/cli/cli/archive/refs/tags/v${GH_VERSION}.tar.gz"
FROM ${BASE_IMAGE} AS one-shot-token-build

COPY one-shot-token/one-shot-token.c /tmp/one-shot-token.c
RUN apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && \
RUN if getent hosts azure.archive.ubuntu.com >/dev/null 2>&1; then \
if [ -f /etc/apt/sources.list ]; then \
sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list; \
sed -i 's|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list; \
fi; \
if [ -d /etc/apt/sources.list.d ]; then \
find /etc/apt/sources.list.d -name '*.sources' -exec \
sed -i -e 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' \
-e 's|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' {} +; \
fi; \
fi && \
apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && \
apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 \
install -y --no-install-recommends gcc libc6-dev binutils && \
gcc -shared -fPIC -fvisibility=hidden -O2 -Wall -s \
Expand Down
1 change: 1 addition & 0 deletions containers/api-proxy/ai-credits-pricing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = Object.freeze({
'gpt-5.6-luna': { input: 1.00, cachedInput: 0.10, cacheWrite: null, output: 6.00 },
'gpt-5.6-sol': { input: 5.00, cachedInput: 0.50, cacheWrite: null, output: 30.00 },
'gpt-5.6-terra': { input: 2.50, cachedInput: 0.25, cacheWrite: null, output: 15.00 },
'gpt-6-astra': { input: 10.00, cachedInput: 1.00, cacheWrite: null, output: 50.00 },
'claude-haiku-4-5': { input: 1.00, cachedInput: 0.10, cacheWrite: 1.25, output: 5.00 },
'claude-sonnet-4': { input: 3.00, cachedInput: 0.30, cacheWrite: 3.75, output: 15.00 },
'claude-sonnet-4-5': { input: 3.00, cachedInput: 0.30, cacheWrite: 3.75, output: 15.00 },
Expand Down
15 changes: 15 additions & 0 deletions containers/api-proxy/guards/ai-credits-guard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ describe('ai-credits-guard', () => {
expect(checkUnknownModelRejection('claude-sonnet-5')).toBeNull();
});

it('resolves gpt-6-astra from curated pricing without unknown-model rejection', () => {
process.env.AWF_MAX_AI_CREDITS = '10';
resetAiCreditsGuardForTests();

const usage = applyAiCreditsUsage({
input_tokens: 2000,
cache_read_tokens: 1000,
output_tokens: 100,
}, 'gpt-6-astra');

// $0.01 per credit: fresh input 1.0 + cached input 0.1 + output 0.5.
expect(usage.aiCreditsThisResponse).toBeCloseTo(1.6, 10);
expect(checkUnknownModelRejection('gpt-6-astra')).toBeNull();
});

it('does not double-count cached tokens when input_tokens is total-inclusive (OpenAI-style)', () => {
// OpenAI (Chat Completions and Responses API) reports prompt_tokens/input_tokens
// as the TOTAL input, with cached tokens being a subset. When no provider is
Expand Down
1 change: 1 addition & 0 deletions src/copilot-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('validateCopilotModel', () => {
'claude-fable-5',
'claude-mythos-5',
'claude-sonnet-5',
'gpt-6-astra',
'mai-code-1-flash',
])('accepts newly supported Copilot allowlist models (%s)', model => {
const result = validateCopilotModel(model);
Expand Down
1 change: 1 addition & 0 deletions src/copilot-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const SUPPORTED_COPILOT_MODELS = new Set([
'gpt-5.6-luna',
'gpt-5.6-sol',
'gpt-5.6-terra',
'gpt-6-astra',
'gpt-5-mini',
'o3',
'o3-mini',
Expand Down
Loading