refactor(coding-agent): centralize agent-message admission in AgentSession (#1861)

* refactor(coding-agent): query agent peers on demand instead of broadcasting mirrors * refactor(coding-agent): centralize agent-message admission in AgentSession * fix(coding-agent): respond to unknown worker commands instead of dropping them Legacy worker_sync_agent_peers commands from an older supervisor fell through handleWorkerCommand without a response, forcing the requester to wait out its full 5s timeout on every peer sync. A default case now writes an immediate failure for any unhandled worker command. * fix(daemon): re-check cron job runnability after prompt admission fence runCronJob snapshotted the runnable job before promptHeartbeat/ promptUntilAccepted, which can wait on the session admission fence. A job cancelled or completed during that wait was still delivered. Re-check via the admissionCommitted hook and skip when the job is no longer runnable. * fix(daemon): skip cron delivery when the job content changed during admission updateRlmHeartbeat mutates prompt/deliveryMode in place under the same job id, so the existence-only admissionCommitted re-check still delivered the stale snapshot captured before the admission fence wait. Compare the refreshed job's prompt and deliveryMode and skip on mismatch; the skip reschedules nextRunAt so the updated instruction is delivered next cycle. * fix(coding-agent): re-check prompt admission after async input normalization _prompt ran admissionCommitted before _normalizeSubmission, but async extension input handlers are awaited between that check and _admitSessionInput, so a cron job cancelled or updated during the await still delivered its stale prompt. Re-run the callback after the awaited normalization so invalidated content is not admitted.

ceb41804 parent 80902713 +892 −2372
browse files