fix: unstick the content pipeline, the quota loop and the outcome retries
Three separate things had the pipeline frozen for 27 hours. browserCrawler leaked page slots. context.newPage() sat outside the try, so a throw or a hang there took the slot with it, and after maxConcurrentPages of those every caller parked in acquirePageSlot forever. That is what it looked like from outside: content workers alive, no logs, no progress, 13 chromium renderers still up 10 hours after start. newPage is inside the try now, waiting for a slot times out instead of blocking forever, and page.close() is raced so a wedged renderer cant strand the slot on the way out either. graphWorker had no backoff on quota failures. A blown OpenRouter monthly limit returns an instant 403, so it retried as fast as the network allowed: 2356 failures in 20 minutes, drowning every other line in the log. Quota and auth errors now pause resolution for 15 minutes and log once per window rather than once per attempt. The outcome worker retried unresolvable predictions forever. Yahoo writes class shares with a dash, so BRK.B 404s every time, and a failed prediction stays open and comes straight back on the next poll. Dots are translated to dashes, which matters beyond this one name because the allowlist is full of dotted symbols, and a prediction that fails five times is marked unresolvable instead of spinning. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnNxwxfXSbeNtjvtz5gayb
This commit is contained in:
@@ -9,6 +9,7 @@ const { calibrateOutcomes, cohortKey } = require('../src/autonomy/calibration');
|
||||
const { decide } = require('../src/autonomy/policy');
|
||||
const { validatePaperIntent, createSimulator } = require('../src/autonomy/execution');
|
||||
const { calculateOutcome } = require('../src/autonomy/outcomes');
|
||||
const { yahooSymbol } = require('../workers/outcomeAutonomyWorker');
|
||||
const { createOrderIntent } = require('../src/autonomy/orderIntents');
|
||||
const { enqueueCoordinatorEvent, reconcileArchiveBatch, reconcileLiveBatch } = require('../workers/autonomyWorker');
|
||||
const { scheduleNext } = require('../workers/replayWorker');
|
||||
@@ -294,3 +295,14 @@ test('event_type is held to the closed family enum', () => {
|
||||
assert.throws(() => typeOf('vibes_shifted'), /event_type must be one of/);
|
||||
assert.throws(() => typeOf(''), /event_type must be one of/);
|
||||
});
|
||||
|
||||
test('dotted tickers are translated to the format the price feed expects', () => {
|
||||
// BRK.B 404d forever and the outcome worker retried it in a hot loop
|
||||
assert.equal(yahooSymbol('BRK.B'), 'BRK-B');
|
||||
assert.equal(yahooSymbol('ABR.PRD'), 'ABR-PRD');
|
||||
assert.equal(yahooSymbol('aac.u'), 'AAC-U');
|
||||
|
||||
// ordinary symbols must pass through untouched
|
||||
assert.equal(yahooSymbol('NVDA'), 'NVDA');
|
||||
assert.equal(yahooSymbol(' spy '), 'SPY');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user