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
97 lines
3.4 KiB
JavaScript
97 lines
3.4 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Check chart data for context overflow
|
|
*/
|
|
|
|
const puppeteer = require('puppeteer');
|
|
const AuthHelper = require('./auth_helper');
|
|
|
|
const BASE_URL = 'http://127.0.0.1:5000';
|
|
|
|
async function checkChartData() {
|
|
console.log('🔍 Checking Context Overflow Chart Data\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
|
|
console.log('📝 Logging in...');
|
|
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');
|
|
|
|
// Check chart data
|
|
if (response.chart_data) {
|
|
console.log(`📈 Chart data points: ${response.chart_data.length}\n`);
|
|
|
|
if (response.chart_data.length > 0) {
|
|
console.log('Sample chart data points:');
|
|
response.chart_data.forEach((point, idx) => {
|
|
console.log(`\nPoint ${idx + 1}:`);
|
|
console.log(` Timestamp: ${point.timestamp}`);
|
|
console.log(` Research ID: ${point.research_id}`);
|
|
console.log(` Model: ${point.model || 'N/A'}`);
|
|
console.log(` Prompt tokens: ${point.prompt_tokens}`);
|
|
console.log(` Actual prompt tokens: ${point.actual_prompt_tokens || 'N/A'}`);
|
|
console.log(` Context limit: ${point.context_limit || 'N/A'}`);
|
|
console.log(` Truncated: ${point.truncated}`);
|
|
console.log(` Tokens truncated: ${point.tokens_truncated || 0}`);
|
|
});
|
|
}
|
|
} else {
|
|
console.log('❌ No chart_data in response');
|
|
}
|
|
|
|
// Check context_limits
|
|
if (response.context_limits) {
|
|
console.log(`\n📊 Context limits data: ${response.context_limits.length} entries`);
|
|
if (response.context_limits.length > 0) {
|
|
console.log('\nContext limits by model:');
|
|
response.context_limits.forEach(limit => {
|
|
console.log(` ${limit.model}: ${limit.limit} tokens (${limit.count} requests)`);
|
|
});
|
|
}
|
|
}
|
|
|
|
} else {
|
|
console.log(`❌ API Error: ${response.message || 'Unknown error'}`);
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error.message);
|
|
} finally {
|
|
if (browser) {
|
|
await browser.close();
|
|
}
|
|
}
|
|
}
|
|
|
|
checkChartData().catch(console.error);
|