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 & Dispatch:
resolveModelNamehandlesupstream:<accountId>:<model>,@cf/, provider prefixes, custommodelMap, and the 65-entryDEFAULT_MODEL_MAP. - 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.