hive-agent: remove the in-container questions mirror

This commit is contained in:
damocles 2026-08-29 21:28:37 +02:00
commit c865114743
7 changed files with 59 additions and 528 deletions

View file

@ -33,9 +33,9 @@ pub use args::{
pub use render::{annotate_retries, format_ack, format_agent_meta, format_recv};
use render::{
dial_agent_socket, format_matrix_summary, local_questions, local_reminders, local_todos,
loose_end_kind_label, mark_local_todo_done, mark_local_todos_done, matrix_unread_summary,
parse_loose_end_kind, render_loose_ends, reply_err,
dial_agent_socket, format_matrix_summary, local_reminders, local_todos, loose_end_kind_label,
mark_local_todo_done, mark_local_todos_done, matrix_unread_summary, parse_loose_end_kind,
render_loose_ends, reply_err,
};
/// Write (or remove) the status file in the agent's own `state/` directory.
@ -293,16 +293,6 @@ impl AgentServer {
if is_self_query && let Some(reminders) = local_reminders().await {
loose_ends.extend(reminders);
}
// Merge local mirrored questions — same self-query-only
// restriction as todos/reminders above. c0re no longer sources
// `Question` rows for `for_agent`/`hive_wide` (see
// `hive-c0re::loose_ends` doc), so this is the only place a
// self-query sees its own questions now; a manager query for a
// child still sees that child's approvals (unaffected) but no
// longer its questions, matching the reminders precedent.
if is_self_query && let Some(questions) = local_questions().await {
loose_ends.extend(questions);
}
annotate_retries(render_loose_ends(&loose_ends), retries)
})
.await
@ -428,15 +418,6 @@ impl AgentServer {
let (resp, retries) = self
.dispatch(hive_core_agent_sock::Request::CancelLooseEnd { kind, id })
.await;
if resp.is_ok() && kind == hive_sh4re::inbox::CancelLooseEndKind::Question {
// Best-effort — cancel is ownership-gated to the asker on
// the c0re side, so a successful cancel here always means
// *this* agent's own `asked` mirror row for `id`. Known gap
// (documented on `Questions`): the target isn't notified,
// so their `answering` row always lingers until it goes
// stale — `answer()` no longer exists as an option.
let _ = dial_agent_socket(&hive_agent_sock::Request::ClearQuestion { id }).await;
}
annotate_retries(
format_ack(
resp,

View file

@ -408,17 +408,6 @@ pub(super) async fn local_reminders() -> Option<Vec<hive_sh4re::inbox::LooseEnd>
}
}
/// Query the harness's in-agent socket for this agent's mirrored questions
/// (both roles — asked and answering). Same best-effort
/// contract as [`local_reminders`]; c0re stays the actual `Ask`/`Answer`
/// routing, this only mirrors the durable "still owed a reply" view.
pub(super) async fn local_questions() -> Option<Vec<hive_sh4re::inbox::LooseEnd>> {
match dial_agent_socket(&hive_agent_sock::Request::ListQuestions).await? {
hive_agent_sock::Response::LooseEnds { loose_ends } => Some(loose_ends),
_ => None,
}
}
/// Mark one of this agent's local todos (loose-ends v2) done by id, via
/// the harness's in-agent socket — reachable through `cancel_loose_end`
/// kind `"todo"` so clearing a todo never has to shell out through a