hive-runtime: exempt ACP compaction turns from the empty end_turn check
A checkpoint or `compact` command turn can end with a bare `end_turn` as a normal answer, since the agent does the work on its side. Treating it as `EmptyEndTurn` made `compact_session` count every such compaction as failed and archive the session. `prompt()` and `turn()` now take a `TurnKind`; only `run()`'s ordinary turns get the check. The test agent's `BLANK` env answers one prompt text with a bare `end_turn`, for the compact and checkpoint tests.
This commit is contained in:
parent
f9c6a56ab9
commit
af8e0fe681
2 changed files with 103 additions and 21 deletions
|
|
@ -89,14 +89,10 @@ impl StreamMapper {
|
|||
out
|
||||
}
|
||||
|
||||
/// Whether the turn has emitted any event.
|
||||
pub(super) fn has_content(&self) -> bool {
|
||||
self.emitted
|
||||
}
|
||||
|
||||
/// Whether the turn has had a `usage_update`.
|
||||
pub(super) fn has_usage_update(&self) -> bool {
|
||||
self.usage.is_some()
|
||||
/// Whether the turn has emitted no event and reported no usage, neither
|
||||
/// in a `usage_update` nor in the `session/prompt` `response`.
|
||||
pub(super) fn sent_nothing(&self, response: &Value) -> bool {
|
||||
!self.emitted && self.usage.is_none() && response.get("usage").is_none()
|
||||
}
|
||||
|
||||
/// The turn's telemetry: context from the last `usage_update`, cost from
|
||||
|
|
|
|||
Loading…
Reference in a new issue