hive-subagent-mcp: give the ACP test agent's replies a token usage
The daemon's own mock ACP agent answered with a bare `end_turn`, no usage, same as hive-runtime's test agent did before EmptyEndTurn: two subagent tests failed because the mock's turns now looked like the provider-error case the runtime backend reports.
This commit is contained in:
parent
af8e0fe681
commit
abd547f600
1 changed files with 5 additions and 3 deletions
|
|
@ -4113,8 +4113,10 @@ mod tests {
|
||||||
/// An ACP agent in plain `sh`, after `hive-runtime`'s own test agent. It
|
/// An ACP agent in plain `sh`, after `hive-runtime`'s own test agent. It
|
||||||
/// has one session, `s1`, appends every method it is sent to
|
/// has one session, `s1`, appends every method it is sent to
|
||||||
/// `<log>.methods` and every `session/prompt` line to `<log>`, and
|
/// `<log>.methods` and every `session/prompt` line to `<log>`, and
|
||||||
/// answers each prompt with `end_turn` — or, in `hold` mode, only once
|
/// answers each prompt with `end_turn` and a token `usage` — or, in
|
||||||
/// `session/cancel` arrives.
|
/// `hold` mode, only once `session/cancel` arrives. The `usage` keeps a
|
||||||
|
/// plain reply from `hive_runtime::acp::AcpError::EmptyEndTurn`, the
|
||||||
|
/// same reason `hive-runtime`'s own test agent's replies carry one.
|
||||||
const ACP_AGENT: &str = r#"
|
const ACP_AGENT: &str = r#"
|
||||||
prompt=
|
prompt=
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
|
|
@ -4133,7 +4135,7 @@ while IFS= read -r line; do
|
||||||
if [ "$2" = hold ]; then
|
if [ "$2" = hold ]; then
|
||||||
prompt=$id
|
prompt=$id
|
||||||
else
|
else
|
||||||
printf '{"jsonrpc":"2.0","id":%s,"result":{"stopReason":"end_turn"}}\n' "$id"
|
printf '{"jsonrpc":"2.0","id":%s,"result":{"stopReason":"end_turn","usage":{"inputTokens":1,"outputTokens":1}}}\n' "$id"
|
||||||
fi ;;
|
fi ;;
|
||||||
session/cancel)
|
session/cancel)
|
||||||
if [ -n "$prompt" ]; then
|
if [ -n "$prompt" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue