Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets the configured Decision Model choose whether eligible unmentioned group messages need primary-agent participation. Example: Decision assistance is enabled in Telegram group -10001, and Alice writes “Bob, see you at lunch.”
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored feature PR open: current main still starts primary generation for these messages, and the proposed participation step has clear value. The prior fixture blocker is fixed; no definite introduced code or security defect remains, although the description still overstates reply-completion guarantees. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherShared reply preparation receives admitted channel messages, assesses eligible group input through the existing Decision runtime, and either records silent input or continues through normal generation and delivery. flowchart TD
A[Group message] --> B[Existing admission]
B --> C[Decision assessment]
C --> D[Primary generation]
D --> E[Channel delivery]
C --> F[Record silent input]
Technical reviewBest possible solution: Retain one pre-generation participation decision within existing admission, transcript, and delivery owners, then complete the applicable live validation. Do we have a high-confidence way to reproduce the issue? This is a feature addition; source confirms that main reaches primary generation before making the proposed participation choice. Is this the best way to solve the issue? The implementation uses the existing Decision runtime and lifecycle owners, preserves ordinary fallback behavior, and keeps response form with the primary model. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 895c50368fee. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +614, Tests +1031, Docs +36, Other -1. Total +1680 across 72 files. Added test files: 8. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (17 earlier review cycles; latest 8 shown)
Reviewed November 22, 2026, 1:18 PM ET / 18:18 UTC (Revision 18). |
683c312 to
53c87ba
Compare
87c26f7 to
5f50e79
Compare
5f50e79 to
d6ed1ea
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem and motivation
When mention gating is disabled in a group, the primary reply model receives admitted messages and decides whether to participate as part of an agent turn. Many of those messages are exchanges between other people, questions that have already been answered, or chatter where another reply would add little value. Starting the primary agent for every such message creates unnecessary work and conversation noise.
Requiring an explicit mention avoids some of that work but misses indirect invitations and useful opportunities to contribute. A configured Decision Model should make the participation choice using the existing group etiquette, while the primary model keeps generating replies in its usual voice.
Solution
With the existing default-off Decision assistance setting enabled and a Decision Model configured, assess eligible unmentioned text messages in always-on groups and channels before primary generation.
The assessment receives the current message, reply reference, bounded recent model history, and bounded workspace identity text. Recent history uses the same reader as normal generation, preserving native message-tool calls and their actual delivery results. Identity context uses the existing workspace loader and context formatter, preserving heading/prose
IDENTITY.mdfiles and configured identity precedence.History preparation runs inside the existing admitted Decision execution, after the selected model’s effective route limits are known. It reserves space for the current message, identity and question, then uses the existing history selector to keep a bounded suffix with complete tool-call/result pairs. In addition to the shared token-pressure estimate, aggregate state/question and request limits set a conservative UTF-8 byte envelope, checked against the complete serialized batch. Provider-specific encoded-input constraints keep their existing handling. It adds no second catalog preparation or provider hook call. If the required input cannot fit, or all prior context would be omitted, the existing ordinary-reply fallback applies. Diagnostics measure the prepared batch rather than its initial placeholder.
The existing admission, transcript, queue, cancellation, permissions, and delivery owners remain responsible for their normal work. A declined queued source is consumed after persistence, so the recorded input is not retried as an abandoned request. The completion owner uses confirmed current-source delivery evidence.
NO_REPLYafter message-tool delivery prevents duplicate output. An undeliveredNO_REPLYremains an unfulfilled reply and follows existing bounded generation recovery and failure handling. Source-delivery retries retain that requirement; they do not make another participation choice. Exhausted or refused retries record failure through the existing runner, and system notices retain their existing permission.Scope and rollout
This uses the existing Decision assistance Labs flag and configured
decisionModel; there is no separate participation setting. An already-saved enabled preference also enables this capability after upgrade.Explicit mentions, commands, media inputs, ambient room events, internal events, and generic CLI backends keep their existing paths. When Decision assistance is disabled or unavailable, the primary model retains its ordinary participation behavior.
Assessments use the selected Decision provider and may incur its normal charges. The provider receives the identity and conversation evidence described above. Each assessment is bounded by the turn timeout and a maximum of 30 seconds.
Validation
The existing approved-text case reproduced approval followed by primary
NO_REPLYcompleting without an answer before the fix, then passed with normal generation recovery and delivery. The existing message-tool case still completes without a duplicate reply. A second revised existing case reproduced queued delivery retry being disabled by the stronger completion policy.Focused validation covered 168 existing cases across five files. After the final source-receipt consolidation, all 73 affected immediate/queued consumer cases passed in 77.02 seconds. The unchanged terminal-resolution and stranded-recovery suites also passed. No test cases or fixture frameworks were added.
The final messaging type-check graph, formatting, syntax guards, whitespace checks, and source/test line ratchets pass. Independent source review is clean. It also traced private transcript receipts, exhausted retry settlement, and refused retry enqueue through the existing owners. The 180-line allocation covers the excess above the 400-line allowance: 580 net test lines retain participation, persistence, source settlement, delivery and prepared-input coverage. The budget repair extends existing cases without adding test cases or a fixture framework.
The history-input repair passes all 11 existing participation/queue cases, the messaging type-check graph, formatting, syntax guards, whitespace checks, and the runtime import-cycle check. An isolated synthetic SQLite transcript reproduces the prior omission and confirms that the shared model-history reader retains the reply text and matching settled source-delivery receipt in order. Independent review is clean; no tests were added for this repair.
A fresh live assessment reached TypeSafe and received HTTP 400 with token-limit wording; the earlier rejection traces remain unattributed. The budget repair passes 102 existing cases across seven focused files (109.38 seconds). After the final interruption correction, all 89 affected Decision host/native cases passed again (46.40 seconds). Messaging and agents-root type checks, formatting, syntax guards, runtime import-cycle and line ratchets pass. Independent source review is clean.
Live validation of that first budget repair still returned unsupported input. A controlled replay through the existing native Gateway Decision tool then compared reconstructed local history with all fields preserved: the approximate selection (85,580 submitted JSON bytes) was rejected; the byte-bounded selection (26,067 bytes, seven messages with complete paired turns) succeeded with 13,990 provider input tokens. A local protocol comparison confirmed HTTP 400 with token-limit wording for the former and HTTP 200 for the latter. These were reconstructed inputs, not captured copies of the original requests; no channel messages were sent.
The follow-up repair changes one production file (+12/-2) and adds no tests. All 13 existing participation/queue/history cases pass, along with the messaging type graph, formatting, focused guards, whitespace and source-line checks. Independent source review is clean. The byte envelope is conservative, not an exact tokenizer guarantee. Exact-commit package installation and live greeting, contextual follow-up and silent-branch validation remain pending.