One Real Run Walkthrough (Source Guide)
Chinese Source Guide
The line-referenced walkthrough is maintained in Chinese at repo-docs/walkthroughs/one-real-run.md in the repository. Switch the site language switcher to 简体中文 to inspect the rendered page in-site.
Summary of Request Lifecycle
- Platform Entry (
src/platforms/{cloudflare,edgeone,esa}.mjs): Injects platform limits (PLATFORM_LIMITS) and runtime state bindings viarunPlatformRequest, then callscreateGateway(runtime).fetch(...)in_worker.js. - Auth & Limits: Enforces ingress size limits (
API_JSON_LIMIT16 MiB; EdgeOne1 MiB), checks clientapiKeysagainst the active state authority (AppConfigStoreDO or remoteSTATE_SERVICE_PATH), and validates payload/replay contracts (validateReplayMetadata,validateToolStrictness). - Model resolution and dispatch. Explicit targets select the provider or account directly. Short names use the saved map and eligible provider declarations. The 48 presets initialize a fresh map. An upgrade preserves the instance's saved aliases.
- Bounded Upstream Fetch (
fetchUpstream): Applies120sheader/idle timeouts and32 MiBresponse caps, failing over across at most 3 shuffled candidate accounts only on explicit401/403/404/429.