stream disconnected before completion: Transport error: network error: error decoding response body
What version of Codex is running?
0.77.0
What subscription do you have?
pro
Which model were you using?
both gpt-5.2 medium & gpt-5.2-codex xhgih occur this error
What platform is your computer?
Windows WSL 2 (Ubuntu 24.04.3 LTS)
What issue are you seeing?
stream disconnected before completion: Transport error: network error: error decoding response body
What steps can reproduce the bug?
Uploaded thread: 019b9110-0fdc-7fc1-8268-36beece381ff
╭─────────────────────────────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.77.0) │
│ │
│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │
│ information on rate limits and credits │
│ │
│ Model: gpt-5.2 (reasoning medium, summaries auto) │
│ Directory: ~/ts-space │
│ Approval: on-request │
│ Sandbox: workspace-write │
│ Agents.md: <none> │
│ Account: bblstd2956@outlook.com (Unknown) │
│ Session: 019b9110-0fdc-7fc1-8268-36beece381ff │
│ │
│ Context window: 94% left (27.2K used / 272K) │
│ 5h limit: [███████████████████░] 97% left (resets 14:39) │
│ Weekly limit: [███████████████████░] 95% left (resets 15:03 on 11 Jan) │
╰─────────────────────────────────────────────────────────────────────────────
Enter the prompts below (5610 chars):
You are an expert Codex Skill designer and senior TypeScript educator practicing
“Vibe Engineering for learning”: learning must be structured, verifiable, milestone-driven,
and oriented toward real engineering outcomes.
Goal:
Create an educational TypeScript skill package with a strict milestone structure.
Learners should progress through concrete, cumulative deliverables rather than isolated lessons.
Overall progression:
- Phase 1 (Early): Type-level thinking and type gymnastics (core focus)
- Phase 2 (Mid): TypeScript + React production engineering (core focus)
- Phase 3 (Late): Node backend engineering and operational readiness (core focus)
Each phase MUST be divided into explicit milestones.
Each milestone MUST:
- have a tangible artifact (code or configuration)
- be verifiable with concrete commands
- unlock the next milestone
Deliverables:
Create a repository skill package under:
.codex/skills/ts-edu/
Each specialization must be its own skill directory with SKILL.md.
Also create:
.codex/skills/ts-edu/INDEX.md (milestone roadmap)
Update:
AGENTS.md at repo root declaring all skills.
Non-negotiable constraints:
1) Milestone-driven learning:
- No “free-form learning”.
- Progression must be gated by passing verification checks.
2) Engineering realism:
- Types are used to solve real engineering problems, not puzzles for their own sake.
3) Repo-aware scaffolding:
- If no TS/React/Node environment exists, create an isolated
ts-playground/
with minimal tooling that supports milestones.
4) Verification-first:
- Every milestone defines exact commands and success criteria.
────────────────────────────────
PHASE 0 — FOUNDATION
────────────────────────────────
Milestone 0.1 — Environment & Toolchain Baseline
Skill: ts-setup-and-tooling
Deliverable:
- Working TypeScript toolchain with strict tsconfig
- Scripts: typecheck, test (if applicable)
Verification:
- npm run typecheck
- tsc --noEmit
Completion unlocks Phase 1.
────────────────────────────────
PHASE 1 — TYPE GYMNASTICS (Primary Focus)
────────────────────────────────
Milestone 1.1 — Type Fundamentals for Engineers
Skill: ts-types-fundamentals
Deliverable:
- A set of typed utilities demonstrating:
- unions, intersections
- narrowing
- generics
Verification:
- tsc passes
- provided type assertions compile
Milestone 1.2 — Real-World Type Gymnastics
Skill: ts-type-gymnastics-core
Deliverable:
- A typed domain:
- typed event map
- typed config schema
- type-safe dispatcher or reducer
- Uses:
- conditional types
- infer
- mapped types
Verification:
- compile-time assertions succeed
- incorrect usage fails compilation
Milestone 1.3 — Type-Level Testing
Skill: ts-type-tests-and-assertions
Deliverable:
- A type-test harness (Expect/Equal or tsd-like)
- At least 5 type-level test cases
Verification:
- type tests pass
- intentional failures are documented
Completion unlocks Phase 2.
────────────────────────────────
PHASE 2 — TYPESCRIPT + REACT ENGINEERING (Primary Focus)
────────────────────────────────
Milestone 2.1 — Typed State Modeling
Skill: ts-react-state-modeling
Deliverable:
- A React feature module with:
- discriminated-union state machine
- typed reducer and actions
Verification:
- Component compiles
- Reducer exhaustiveness enforced
Milestone 2.2 — Typed Components & Hooks
Skill: ts-react-components-and-hooks
Deliverable:
- One reusable component
- One custom hook with a typed public API
Verification:
- Component usage errors caught at compile time
- No implicit any
Milestone 2.3 — API Integration & Runtime Safety
Skill: ts-react-integration-patterns
Deliverable:
- Typed API client
- Runtime validation (zod/manual)
- Typed error flow into UI
Verification:
- Mock API integration test passes
- Runtime invalid data is handled safely
Completion unlocks Phase 3.
────────────────────────────────
PHASE 3 — NODE BACKEND ENGINEERING (Primary Focus)
────────────────────────────────
Milestone 3.1 — Node Service Blueprint
Skill: ts-node-service-blueprint
Deliverable:
- Minimal Node service with:
- folder layout
- config/env handling
- structured logging
- error taxonomy
- one typed endpoint
Verification:
- Service starts
- Endpoint returns typed response
- typecheck passes
Milestone 3.2 — Testing & Quality Gates
Skill: ts-node-testing-and-quality-gates
Deliverable:
- Unit + integration tests
- Lint/typecheck/test gates defined
Verification:
- npm test
- npm run typecheck
- lint passes
Milestone 3.3 — Ops & Performance Basics
Skill: ts-node-perf-and-ops-basics
Deliverable:
- graceful shutdown
- health endpoint
- basic profiling instructions
Verification:
- service shuts down cleanly
- health endpoint reflects state
────────────────────────────────
ROUTER & NAVIGATION
────────────────────────────────
Skill: ts-edu-router
Purpose:
- Detect learner’s current milestone
- Recommend the next milestone
- Block skipping steps without verification
INDEX.md requirements:
- Visual milestone roadmap
- Phase → milestone → skill mapping
- “How to start” and “How to resume”
Execution rules for THIS run:
- Generate skills, INDEX.md, and AGENTS.md only.
- Scaffold
ts-playground/only if required. - Do NOT refactor existing production code.
- Output full contents of all created files with exact paths.
Now proceed:
1) Inspect the repo for existing TS/React/Node setup.
2) Generate .codex/skills/ts-edu/ with milestone-aware SKILL.md files.
3) Create INDEX.md describing the full milestone path.
4) Update AGENTS.md.
5) Provide a concise “Start Here” guide (first command to run).
Error occurred during the response: stream disconnected before completion: Transport error: network error: error decoding response body
What is the expected behavior?
Codex should be able to stably and continuously stream responses under long-duration or large-volume output scenarios, correctly completing data transmission and decoding throughout the entire response lifecycle, without interruption due to decoding or transmission anomalies before the response ends.
When the response content is long, the system should possess one or more of the following capabilities:
Correctly handle the fragmentation, reassembly, and decoding of large-volume streaming data;
Avoid internal failures triggered by excessively long output during the inference phase;
Maintain stable connections for long response bodies at the network transport layer, preventing premature stream disconnection due to timeouts, buffer overflows, or connection resets;
In extreme cases, be able to perform explicit degradation processing (such as safe truncation, explicit error messages) rather than returning ambiguous transport/decoding errors.
The current anomaly is unclear as to which of the following types of problems it is caused by:
Failure during model inference or decoding due to excessively long response length;
Stream interruption at the network or transport layer due to excessively large response bodies, excessively long transmission times, or unstable connections.
The system is expected to be able to clearly distinguish and properly handle the above scenarios, thereby ensuring the reliability and predictability of the streaming response.
Additional information
This problem also occurs with gpt-5.2 medium, not just gpt-5.2-codex xhigh.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗