7a0da7932b
Backwards Compatibility / Verify Encryption Constants (push) Waiting to run
Backwards Compatibility / PyPI Version Compatibility (push) Waiting to run
Backwards Compatibility / Database Migration Tests (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-form] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-metrics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-workflow] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [history-news] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [library] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [link-analytics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [mobile] (push) Blocked by required conditions
Docker Tests (Consolidated) / detect-changes (push) Waiting to run
Docker Tests (Consolidated) / Build Test Image (push) Waiting to run
Docker Tests (Consolidated) / All Pytest Tests + Coverage (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [accessibility] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [api-crud] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-login] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-register] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-lifecycle] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [error-benchmark] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) (push) Blocked by required conditions
Docker Tests (Consolidated) / Accessibility Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Unit Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Example Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / Production Image Smoke Test (push) Blocked by required conditions
Docker Tests (Consolidated) / Infrastructure Tests (push) Blocked by required conditions
OSSF Scorecard / OSSF Security Scorecard Analysis (push) Waiting to run
OSV-Scanner (Scheduled) / scan-scheduled (push) Failing after 0s
Create Release / test-gate (push) Has been cancelled
Create Release / release-gate (push) Has been cancelled
Create Release / ci-gate (push) Has been cancelled
Create Release / version-check (push) Has been cancelled
Create Release / e2e-test-gate (push) Has been cancelled
Create Release / responsive-test-gate (push) Has been cancelled
Create Release / compat-test-gate (push) Has been cancelled
Create Release / compose-integration-gate (push) Has been cancelled
Create Release / vulture-gate (push) Has been cancelled
Create Release / build (push) Has been cancelled
Create Release / provenance (push) Has been cancelled
Create Release / prerelease-docker (push) Has been cancelled
Create Release / publish-docker (push) Has been cancelled
Create Release / create-release (push) Has been cancelled
Create Release / cleanup-changelog (push) Has been cancelled
Create Release / trigger-pypi (push) Has been cancelled
Create Release / monitor-pypi (push) Has been cancelled
Create Release / Clean up orphan prerelease tags and signatures (push) Has been cancelled
111 lines
4.4 KiB
JavaScript
111 lines
4.4 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Direct API check for context overflow data
|
|
*/
|
|
|
|
const puppeteer = require('puppeteer');
|
|
const AuthHelper = require('./auth_helper');
|
|
|
|
const BASE_URL = 'http://127.0.0.1:5000';
|
|
|
|
async function checkAPI() {
|
|
console.log('🔍 Checking Context Overflow API directly\n');
|
|
|
|
let browser;
|
|
let page;
|
|
|
|
try {
|
|
browser = await puppeteer.launch({
|
|
headless: true,
|
|
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
|
});
|
|
|
|
page = await browser.newPage();
|
|
const authHelper = new AuthHelper(page, BASE_URL);
|
|
|
|
// Login with the specific test user
|
|
console.log('📝 Logging in as testuser_1755337395122_150...');
|
|
await authHelper.login('testuser_1755337395122_150', 'T3st!Secure#2024$LDR');
|
|
console.log('✅ Logged in\n');
|
|
|
|
// Make API request
|
|
console.log('🔌 Fetching context overflow data...');
|
|
const response = await page.evaluate(async (baseUrl) => {
|
|
const res = await fetch(`${baseUrl}/metrics/api/context-overflow?period=all`, {
|
|
method: 'GET',
|
|
credentials: 'include',
|
|
headers: {
|
|
'Accept': 'application/json'
|
|
}
|
|
});
|
|
|
|
const data = await res.json();
|
|
return data;
|
|
}, BASE_URL);
|
|
|
|
if (response.status === 'success') {
|
|
console.log('✅ API Response successful\n');
|
|
|
|
console.log('📊 Overview:');
|
|
console.log(` Total requests: ${response.overview.total_requests}`);
|
|
console.log(` Requests with context data: ${response.overview.requests_with_context_data}`);
|
|
console.log(` Truncated requests: ${response.overview.truncated_requests}`);
|
|
console.log(` Truncation rate: ${response.overview.truncation_rate}%`);
|
|
console.log(` Avg tokens truncated: ${response.overview.avg_tokens_truncated}\n`);
|
|
|
|
if (response.model_stats && response.model_stats.length > 0) {
|
|
console.log('🤖 Model Stats:');
|
|
response.model_stats.forEach(stat => {
|
|
console.log(` ${stat.model} (${stat.provider}):`);
|
|
console.log(` Total: ${stat.total_requests}, Truncated: ${stat.truncated_count}`);
|
|
console.log(` Rate: ${stat.truncation_rate}%, Avg Context: ${stat.avg_context_limit}`);
|
|
});
|
|
console.log('');
|
|
}
|
|
|
|
if (response.recent_truncated && response.recent_truncated.length > 0) {
|
|
console.log('⚠️ Recent Truncated Requests:');
|
|
response.recent_truncated.slice(0, 3).forEach(req => {
|
|
console.log(` ${req.timestamp}: ${req.model}`);
|
|
console.log(` Tokens: ${req.prompt_tokens}, Limit: ${req.context_limit}, Lost: ${req.tokens_truncated}`);
|
|
});
|
|
console.log('');
|
|
}
|
|
|
|
if (response.chart_data && response.chart_data.length > 0) {
|
|
console.log(`📈 Chart data points: ${response.chart_data.length}`);
|
|
|
|
// Check if any have context data
|
|
const withContext = response.chart_data.filter(d => d.context_limit).length;
|
|
const truncated = response.chart_data.filter(d => d.truncated).length;
|
|
|
|
console.log(` Points with context limit: ${withContext}`);
|
|
console.log(` Truncated points: ${truncated}\n`);
|
|
|
|
// Show first few data points
|
|
if (response.chart_data.length > 0) {
|
|
console.log(' Sample data points:');
|
|
response.chart_data.slice(0, 3).forEach(point => {
|
|
console.log(` ${point.timestamp.substring(0, 19)}: ${point.model || 'N/A'}`);
|
|
console.log(` Tokens: ${point.prompt_tokens}, Actual: ${point.actual_prompt_tokens}`);
|
|
console.log(` Context Limit: ${point.context_limit || 'N/A'}, Truncated: ${point.truncated}`);
|
|
});
|
|
}
|
|
}
|
|
|
|
} else {
|
|
console.log(`❌ API Error: ${response.message || 'Unknown error'}`);
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error.message);
|
|
} finally {
|
|
if (browser) {
|
|
await browser.close();
|
|
}
|
|
}
|
|
}
|
|
|
|
checkAPI().catch(console.error);
|