Is session.idle a causal accounting/event-completeness boundary in the native/headless protocol?

未關閉
#2,809 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
10/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
活躍

研究方向

Start from the SDK documentation that defines session.idle semantics and the generated event surface (assistant.usage, session.usage_info, session.usage_checkpoint, session.compaction_start/complete, assistant.turn_end, assistant.idle) in github/copilot-sdk; trace where those events are produced and where session.idle is enqueued for CLI 1.0.92-3 (and 1.0.91 if semantics differ). Read issue #4743 only for contrast — it covers ACP prompt completion, which this question explicitly excludes. Done means a versioned YES / NO / UNSPECIFIED statement about causal emission ordering, plus any stronger supported RPC, event, watermark or barrier if the answer is NO or UNSPECIFIED.

由索引模型根據 Issue 內容生成。

描述

question

We integrate GitHub Copilot CLI through the public Copilot SDK and need a deterministic session/accounting completion boundary. This is a protocol-contract question, not a request for a timing workaround.

For Copilot CLI 1.0.92-3 (bundled by github/copilot-sdk v1.0.17-preview.3, commit ef04633), the current public documentation describes session.idle as the point where the agent has finished all processing, is ready for the next message, and the turn is fully complete.

The generated event surface also includes events such as:

  • assistant.usage
  • session.usage_info
  • session.usage_checkpoint
  • session.compaction_start
  • session.compaction_complete
  • assistant.turn_end
  • assistant.idle
  • session.idle

The remaining question is specifically about causal event emission ordering.

For CLI 1.0.92-3, and if the semantics differ please also note CLI 1.0.91:

When a client observes session.idle on the native/headless protocol stream, is it guaranteed that every session event/notification attributable to work completed before that idle point has already been generated and enqueued onto the ordered client transport?

In particular, after the observed session.idle, can any event attributable to the preceding work still legitimately be generated/emitted that changes usage/accounting or other completion-relevant state, including assistant.usage, session.usage_info, session.usage_checkpoint, or compaction-related accounting?

A concise versioned answer in one of these forms is sufficient:

YES, guaranteed for version X — before session.idle is emitted, all producers relevant to the preceding work are finalized and all corresponding events are queued into the ordered transport domain; no accounting/completion-relevant event attributable to that preceding work can legitimately be emitted afterward.

NO — session.idle guarantees that agent processing has stopped / the turn is complete in the documented sense, but it is not an event/accounting emission fence.

UNSPECIFIED / unsupported contract — the implementation may currently exhibit an ordering, but SDK clients must not depend on that ordering.

If the answer is NO or UNSPECIFIED, is there another currently supported native/headless RPC, event, watermark, or barrier that provides the stronger property?

We are specifically not treating sleeps, quiet periods, repeated polling, local queue-empty observations, or ordinary JSON-RPC response ordering as substitutes for such a guarantee.

The distinction matters because FIFO transport can prove ordering for frames that have already entered the transport, but cannot by itself prove that an upstream/background producer will not subsequently create another event attributable to the preceding work.

A version-specific semantic statement is sufficient; no proprietary backend implementation details are required.

This question is related to, but intentionally narrower than, github/copilot-cli#4743: that issue concerns ACP prompt completion. Here the question is specifically about the existing native/headless session.idle contract used by the public Copilot SDK.

主要語言
Java
星號
10.7k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。