Subagents
Codex subagent workflows ช่วยให้ agent เฉพาะทางทำงานแบบคู่ขนาน ทำให้ main agent มี focus ขณะที่มอบหมายงานกลางๆ ออกไป
ทำไม Subagent Workflows จึงมีประโยชน์
Subagents แก้ปัญหา 2 อย่างหลัก:
- Context pollution — output กลางๆ (logs, tests, traces) ฝัง context ที่มีประโยชน์
- Context rot — ประสิทธิภาพลดลงเมื่อการสนทนาสะสม detail ที่ไม่เกี่ยวข้อง
ประโยชน์ที่ได้:
- Main agent มี focus กับ requirements และ decisions
- Subagents จัดการ exploration, testing และ analysis แบบคู่ขนาน
- มีเพียง summaries ที่ส่งกลับไปยัง main thread
- มีประสิทธิภาพสูงโดยเฉพาะสำหรับงานที่ read-heavy เช่น exploration, testing และการวิเคราะห์เอกสาร
คำศัพท์หลัก
| คำศัพท์ | ความหมาย |
|---|---|
| Subagent workflow | Codex รัน parallel agents และรวมผลลัพธ์ |
| Subagent | Delegated agent ที่จัดการงานเฉพาะ |
| Agent thread | CLI thread สำหรับ agent (ดูได้ผ่าน /agent) |
การเรียกใช้ Subagents
Subagents ต้องการคำแนะนำจากผู้ใช้อย่างชัดเจน โดยไม่ spawn อัตโนมัติ ค่าใช้จ่าย token สูงกว่า single-agent run เนื่องจาก subagent แต่ละตัวทำงาน model และ tool แยกกัน
การเลือก Model และ Reasoning
การเลือก Model
| Model | การใช้งาน |
|---|---|
gpt-5.5 | ค่าเริ่มต้นสำหรับงานที่ซับซ้อนและหลายขั้นตอน |
gpt-5.4 | สำหรับ workflow ที่ pin ไว้ที่ GPT-5.4 |
gpt-5.4-mini | เน้นความเร็วสำหรับ exploration และ parallel workers |
gpt-5.3-codex-spark | Research preview สำหรับการทำซ้ำ text แบบ near-instant (ChatGPT Pro) |
Reasoning Effort
| ระดับ | การใช้งาน |
|---|---|
high | Logic tracing ที่ซับซ้อนและ security analysis |
medium | ค่าเริ่มต้น balanced |
low | งานตรงไปตรงมาที่เน้นความเร็ว |