code-review-context

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Codex maintains a context (history of messages) that is sent to the model in inference requests.
  1. No history rewrite - the context must be built up incrementally.
  2. Avoid frequent changes to context that cause cache misses.
  3. No unbounded items - everything injected in the model context must have a bounded size and a hard cap.
  4. No items larger than 10K tokens.
  5. Highlight new individual items that can cross >1k tokens as P0. These need an additional manual review.
  6. All injected fragments must be defined as structs in
    core/context
    and implement ContextualUserFragment trait
Codex 维护一个上下文(消息历史记录),在推理请求中发送给模型。
  1. 不重写历史记录 - 上下文必须逐步构建。
  2. 避免频繁修改上下文导致缓存未命中。
  3. 无无界项 - 注入模型上下文的所有内容必须有固定大小和硬上限。
  4. 没有超过10K tokens的项。
  5. 将超过1k tokens的新单个项标记为P0优先级。这些需要额外的人工审核。
  6. 所有注入的片段必须在
    core/context
    中定义为structs,并实现ContextualUserFragment trait