fix(secops): confirm on Telegram when an inline answer lands - #167
Merged
Conversation
Answering a BLOCKED secops question while the session is still alive produced no feedback. The only completion message is the sweep-wide summary, which fires once every repo has been swept — on a 90-repo sweep that is hours after the reply, so answering felt like the bot had ignored it. The late-answer path (pending_resumes sweeper) already sends a per-session result. Give the inline path the same treatment: after the BLOCKED loop exits, report the outcome — merged summary, re-blocked question, or error — for the repo the operator answered. Guarded on rounds > 0 so the repos that never asked anything stay silent; a daily ack from all 90 is how operators learn to ignore the channel. The send is best-effort: a dead bridge socket must not discard work the agent already completed or abort the rest of sweep.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Answering a BLOCKED secops question produced no confirmation when the
session was still alive to receive the answer.
What the logs showed
Five questions went out on the 2026-09-09 sweep. Four were answered
inline; every one of them did real work:
ai-minerkenos-orchestratorprompt-injection-benchmarkaiproxyguard-promptest20 PRs merged, and not one
SENDframe went back to the operator.The bridge log between the first answer (07:22) and the end of the
sweep contains
delivering ANSWERfour times and no outbound message.Why
Two paths reach a resumed session, and only one of them reports.
in
pending_resumes, and the sweeper incli.pysends✅ Resume succeeded on <repo>per session. This has always worked.transport.ask,so it resumed in-process inside
run_secops_all. That loop appendedthe result and moved to the next repo. Nothing was sent.
The only completion message on the inline path is the sweep-wide
✅ Scheduled secops sweep done: N/M ok, which fires after every repohas been swept. That sweep ran 06:00 → past 07:54 across ~90 repos, so
the operator's feedback for a 07:22 answer was a bare count, hours
later, naming no repo.
The change
After the BLOCKED loop exits, report the outcome for the repo the
operator actually answered — success summary, the new question if it
re-blocked, or the error. Same three shapes the
pending_resumessweeper already sends, so both paths now read identically in Telegram.
Two constraints shaped it:
rounds > 0. Most of a 90-repo sweep finds nothing todecide. Acking those turns this into ~90 notifications a day, which
is how an operator learns to ignore the channel.
agent already completed or abort the remaining repos, so the send is
wrapped and logged as
secops.answer_ack.send_failed.Verification
Four tests in
TestSecopsInlineAnswerAck, covering the ack, there-block, the silence guard, and a failing socket.
Reverting
secops.pyalone fails exactly the two that assert the newmessages, and passes the other two:
Full suite: 932 passed.
ruffclean.mypyreports 21 errors, all 21also present on
mainand none in the touched file.