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: blocked before merge. What this changesAdds optional AI-generated Discord thread names after a configurable conversation threshold. Example: A new Discord thread named Untitled has autoName set to 2.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open for owner acceptance of the feature and SDK contract; no actionable code findings remain, and its same-author request is still open. Priority: P3 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherDiscord Gateway events enter the plugin’s naming lifecycle, which admits conversation text, generates a title through the selected agent, and applies it through Discord REST. flowchart TD
A[Discord Gateway events] --> B[Thread naming lifecycle]
B --> C[Current policy and member authority]
C --> D[Persistent claim and budget]
D --> E[Bound or routed agent]
E --> F[Isolated title generation]
F --> G[Authorized Discord REST request]
Technical reviewBest possible solution: An area owner should accept or narrow the opt-in naming lifecycle and supported SDK contract before this implementation lands. Do we have a high-confidence way to reproduce the issue? This requests new behavior; current main provides creation-time generated names without a later conversation threshold. Is this the best way to solve the issue? The implementation uses the appropriate Discord plugin and existing policy, binding, label, REST, and worker-storage owners, subject to acceptance of its additional product contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 44b487a6ae6c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +983, Tests +1695, Docs +47, Generated 0. Total +2725 across 32 files. Added test files: 3. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 (14 earlier review cycles; latest 8 shown)
Reviewed October 16, 2026, 6:58 PM ET / 22:58 UTC (Revision 15). |
eleqtrizit
left a comment
There was a problem hiding this comment.
Reviewed 3b52cb706383c709d4e209e6ae49f9be19a6014e. The bounded transcript, persistent attempt budget, and authority checks through model dispatch and queued REST retries are good. Requesting changes for the agent-selection defect and transcript-window edge case below. Please add focused regressions for both and rerun the relevant checks on the resulting head.
This review is based on source/test inspection and the successful exact-head CI run; I did not independently execute the tests or repeat the live Discord demonstration.
eleqtrizit
left a comment
There was a problem hiding this comment.
Re-reviewed 184d484308b2.
Resolved from my previous review
- Agent selection: title generation now resolves the agent through the existing Discord binding/route resolver, so the thread's bound or routed agent is used instead of the default agent. The new runtime tests cover parent, account, role and bound routing, and ownership changes during preparation and fallback.
- Human admission:
state.humankeeps the admitting human outside the rolling 20-message window. Thresholds 21 and 22 are now covered.
Thanks for the fixes. This review is based on source and test inspection and the passing required openclaw/ci-gate checks. I did not execute the tests or repeat the live Discord demonstration on this head.
Still needed before this can land
- Merge conflict. Merging current
main(72048b61942) conflicts indocs/.generated/config-baseline.sha256. Please rebase and regenerate it canonically, then rerun checks. - Docs gaps.
docs/gateway/config-channels/community-chat.mddocuments the other Discord keys (for examplethreadBindings), butthread.autoNameis not listed there.- The user docs do not say that changing
autoNameorenableduses the existing Discord channel restart. Only the PR body does. - The strict thread schema means a config containing
autoNamefails validation on a release that lacks the key. Please add a downgrade note: remove the key before rolling back.
- Legacy-claim compatibility. The PR keeps code and tests for legacy non-expiring boolean claims. I could not find that format on
main. Please cite where it shipped, or drop it per the rootAGENTS.mdrule on retained compatibility. - Policy invalidation.
live-policy.tsnow includesenabled,actionsandthreadin the authored policy revision.message-handler.preflight.tsreturnsnullwhenisPolicyCurrent?.() === false. Please confirm, ideally with a test, that changingthread.inheritParentoractionsdoes not drop an in-flight message beyond the existing channel-restart behavior. If that is accepted, say so. - Maintainer decision. I found no recorded acceptance of the new setting, model processing and persisted lifecycle on this PR or on #160865. That decision is still open.
Non-blocking notes
isConfigCurrentcompares object identity, so any config write during a title run abandons the attempt after the claim and budget are spent. The docs describe the behavior; a short code comment would make it an explicit accepted tradeoff.- Role-based routing uses the roles of the single retained human, while message preflight uses each author's roles. In a thread with several humans on different role bindings, the naming agent can differ from the answering agent. Please note it as accepted.
thread-auto-name.tsimportsconversation-binding-runtimestatically and is reachable fromprovider.startup.ts; the routing preflights load it lazily.native-command.tsalready imports it statically, so the cost may not be new, but I did not run the startup profiler the plugin-SDK guide calls for.
I am leaving my earlier change request in place until items 1-5 are addressed.
eleqtrizit
left a comment
There was a problem hiding this comment.
Code review of a647bb349850. I found no correctness or security blockers in the current code. The agent-selection and human-admission fixes look right, and the new in-flight preflight test is a good addition. Remaining notes are maintainability items on the inline comments below, plus two points from my earlier review that are still open:
- Maintainer decision. I still see no recorded maintainer acceptance of the new setting, model processing and persisted lifecycle on this PR or on #160865.
- PR body. Please check that it no longer describes the legacy-claim handling that was removed in
7ad5ea492ac.
This review is based on source and test inspection. I did not run the tests, the startup profiler or the docs checks, and I did not repeat the live Discord demonstration on this head.
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Updated head |
|
🦞👀 Re-review progress:
|
|
Context for a second maintainer opinion on the product decision here (feature acceptance is the open item from review). Precedent: we already do automatic, model-generated naming in two places.
Both feed through the shared isolated-completion label runtime ( What's genuinely new in this PR, and where a judgment call is needed:
So the model-processing aspect is precedented; the durable lifecycle is the new commitment. The question I'd put to a second maintainer: are we comfortable shipping the persisted attempt/budget lifecycle as part of the Discord plugin contract, and is the threshold-triggered transcript input acceptable given the existing creation-time and first-turn behaviors? (Note: head is |
jacobtomlinson
left a comment
There was a problem hiding this comment.
I have some reservations about the design here. This is a new behaviour which I can't find precedent for, but I have desired for sure. The high-level question that this PR opens is "given that we name sessions/threads automatically, should we also rename those threads later into the conversation if the conversation changes direction?". Assuming the answer is yes we then need to figure out the details of how to do that so we can do it consistently across channels and reduce the amount of new config options instroduced.
Right now it seems like we consistently set the name based on the initial message (verified in discord, telegram, control UI, etc). Annoyingly it looks like we don't have a consistent configuration scheme for doing this across connectors, discord calls it autoThreadName and telegram calls it autoTopicLabel. These are acceptable names for each platform but makes it a little hard to figure out what to call this new option with an eye to expanding it to other channels later.
It also looks like the changes here are mutually exclusive with the existing autoThreadName option, so if the thread is named on first message that cancels the later rename. The autoThreadName is also a channel specific configuration, whereas this new option is guild-wide.
I think we need to take a small step back and think about how we want this to be implemented broadly across OpenClaw. I'm not suggesting we try and land a monolith PR that adds this for all channels, but we should try and land a pattern that make it easy for us to follow up and implement consistently in all other channels.
Thanks, Jacob. I agree we should establish consistent naming behavior before committing to another configuration option. |
|
FYI we have a core goal of reducing configuration complexity, we already have a very complex config schema. PRs that change config or sqlite schema will get less traction with maintainers at the moment. Lets try and refine and simplify. IMHO agents should own naming sessions/threads, and I think it's fine for them to periodically rename if the conversation diverges from the title. If a user manually renames a session it should end automatic renaming. We may want one more simplified enable/disable toggle for automatic naming. Choosing when to rename could be a good opportunity to leverage the decision model support. A small decision on whether the recent conversation is still reflected by the current title would be an easy trigger. |
|
Thanks, Jacob. That direction makes sense. I’ll propose a simpler design around agent-owned ongoing naming, using the existing decision support to check whether the current title still fits and the existing label generator when a replacement is needed. Manual renames would end automatic naming. I’ll also revisit the threshold setting and one-time bookkeeping, aiming to reuse existing configuration and state. I’ll outline the behavior—including what happens without a configured decision model—for agreement before reshaping the Discord implementation. |
|
Following up on my earlier comment: Building on your suggestion, I’d simplify this into ongoing naming managed by the conversation’s agent, with the naming work running outside the main conversation:
“Agent-owned” means using the conversation’s agent settings and authority without adding naming work to its main chat history. I’d implement Discord first, with consistent behavior that Telegram and the dashboard can adopt later. Two questions to settle before implementation:
|
Related: #160865
What Problem This Solves
New Discord threads can keep generic titles after a conversation develops. This adds optional naming after an admitted conversation reaches a configured message threshold.
User Impact
channels.discord.thread.autoNamedefaults tofalse;trueuses five messages, a positive integer sets the threshold, and0disables it. Account settings override the channel-wide value. A bounded recent transcript goes to an isolated title run using the thread’s bound or routed agent and its utility model, with primary-model fallback. Other bots and webhooks do not contribute. Generated identifiers retain underscores.Naming requires
intents.guildMembers: truefor the selected account and Server Members Intent in Discord’s Developer Portal. Without this existing privileged subscription, OpenClaw skips naming and explains the requirement at startup. It does not enable the intent automatically.Changing
autoNameorenableduses the existing Discord channel restart. Before downgrading to a release without the setting, remove theautoNamekey at the channel and every account scope;falseis still an unknown key to that release’s strict schema.Naming applies to newly observed threads in their first 24 hours. Threshold crossing spends one persisted attempt even if permissions, budget, or later revocation prevent naming. Claims expire after 24 hours and are deleted with the thread. Each account/parent permits two attempts per ten minutes; both protection stores reject new entries at 10,000 rows. Transcripts are not persisted. No non-expiring legacy-claim reader or repair remains.
Maintainer decision remains open: acceptance of the new setting, transcript/model processing, persisted lifecycle, and
prepareSessionBindingInspectionsexport through the existing binding SDK subpath is still required. Neither this PR nor #160865 records that acceptance; the existing change request has not been dismissed.Review Follow-up
Fresh member reads alone did not invalidate retained roles during awaited preparation or queued retries. Discord’s existing native entity-invalidation owner now retains disposable member authority before those reads and invalidates it before listener queueing. The naming route and REST request owner assert that authority before model dispatch/fallback and each physical request/retry, then release it in
finally. This covers every contributing human, membership removal, guild role changes/removal, Gateway disconnection, and session replacement. Unrelated members do not cancel the attempt. Relevant membership events conservatively cancel even if the updated roles would still allow access; the consumed claim/budget is not refunded.Existing config/binding/routing/lifecycle checks remain. Any effective config replacement, including unrelated changes, abandons an active naming attempt. Ordinary in-flight replies retain existing channel-restart behavior for naming, enablement, and action edits. Naming role routing uses the most recently admitted human, so it can differ from another author’s replying agent.
Rebased onto main
3e55551264e9483422ad1b0dd82c38a78aa9a52c. The actual conflict included upstream’s listener-base-class removal; naming listeners now use the current typed event contract without restoring retired classes. Channel metadata and documentation baselines were regenerated with their canonical generators.Evidence
Published head:
28dfc4980b5e82e3f492b896a76c8b157912734f. Source tree:29053d663332f22b6e13fadfa4bf322cad5653ec. Current-head CI run 38969845498 completed successfully: all 79 jobs finished with no failures, including every test-types stripe, the baseline ratchets, the Discord bundle, and the CI gate job. Both requiredopenclaw/ci-gatechecks pass; the separate combined status confirms CI and applicable security-review requirements passed (publisher run 38971041246).The local repair proof below was completed at
2f64e5d046ac305f84cc8400bffa45422962920f, before the final conflict-only sync. All feature production/test/docs blobs were identical immediately after that sync (6b6fa94377). The changed test-planner entry is upstream’s Codex history-seed test; the final config hash was regenerated and checked canonically. The subsequent CI cleanup only shares the existing checked member extraction and migrates one Gateway test fixture to upstream’s current runtime-registry owner; it does not change naming admission or test assertions.ClawSweeper Revision 13 reviewed this exact head and reports no actionable findings, no security concern, sufficient behavior proof, and a single remaining blocker: maintainer acceptance of the feature, persisted/model-processing lifecycle, and supported SDK export. No maintainer approval has been inferred or substituted.
The current production-path harness uses actual Gateway dispatch, entity invalidation, label/isolated-completion preparation, and the queued REST scheduler, with synthetic provider and Discord I/O. It does not claim a new live Discord/model demonstration.
Before the repair, the regressions produced eight intended failures: utility/primary dispatch still occurred after revocation, queued retries sent a second PATCH, and absent event authority still allowed naming. Allowed controls passed. After repair, all 98 focused tests across seven files passed (107.44s wrapper wall time), including 57 naming/runtime/persistence cases and 41 cache/client/Gateway/startup cases. Both extension production and test typechecks passed.
Both extension typechecks, canonical metadata/baseline checks, MDX, formatting, and staged-content checks passed. Typed lint caught raw-string/enum comparisons; the existing native event classifier now selects the invalidation kind once, preserving behavior. Typed lint then passed with zero warnings/errors, and all 19 affected cache/deferred-authority cases passed again (54.48s wrapper). Final production/test typechecks passed in 49.06s/76.67s. At
6b6fa94377, the full build passed in 225.6s, including all 155 SDK export checks and CLI bootstrap import checks. The isolated Discord cold-import snapshot qualified with no gaps: 104.64 MiB maximum RSS against a 43.86 MiB baseline, and the temporary home was removed. This measures cold import, not full Gateway startup. That build/profile predates the two-file CI cleanup described below; earlier dirty-source/build-stamp screenings are not qualified evidence.The requested independent subagent review found and verified the correction of a misplaced configuration-help sentence; no P0–P3 findings remain. Canonical
autoreviewcompleted all three passes with P0–P2scoped-clean; the help correction, regenerated outputs, and behavior-preserving event-classifier refactor were separately verified. The independent subagent re-reviewed the classifier and found no P0–P3 issues. Both reviews were static; execution evidence is recorded above.CI run 38968359028 exposed two repair-owned issues: the rebase left a removed registry helper in one Gateway test (runtime and test-types failures), and member extraction duplicated an assertion (baseline failure). The fixture now uses the same runtime registry builder and awaited disposal as its sibling; member invalidation shares one checked extraction. No baselines, timeouts, or assertions were weakened. The repaired Gateway integration tests (2), root-other test typecheck, cache tests (5), assertion-safety ratchet, formatting, typed lint, and staged guard passed. All 11 selected production-path model-authority and queued-retry regressions passed again after the extraction cleanup (53.01s wrapper); 43 unrelated cases were not selected in this repeat. Fresh canonical autoreview completed P0–P2 scoped-clean, and the independent subagent found no P0–P3 issues in either CI repair.
Standalone changed-file timings on the secretless four-CPU Node 24.19.0 container: naming 59.55s wall (37 cases), runtime 66.87s wall (17 cases), including worker compilation and concurrent build activity. These suites exercise real credential/routing preparation, worker persistence, and serialized effects; replacing those owners with mocks would miss the reviewed boundary. Individual CI test-case timings were not collected.
Latest-stable upgrade proof
Actual npm
[email protected]and@openclaw/[email protected], from release v2026.10.4 at383c124cc32ffee3f8e56f549b88da94d269a4af, wrote the synthetic existing configuration and two supported account bindings using their shipped owners. The candidate’s real Doctor schema owner migrated shared-state schema 20→26; both released bindings and every stored column stayed exact. Config bytes retained SHA-25646fd7c3c97a8ed54551228abf96145c46f9d27ffcf40668511b4397d88f22c02; naming remained off without the new key. Enabling the setting in memory validated, and only the two new expiring naming namespaces were added. Their consumed claim and exhausted two-attempt budget survived physical database close/reopen while existing records/config remained intact. The canonical database harness passed (2.110s case, 43.67s wrapper). All 20 individually examined owner files are identical between that proof’s pinned82448706cc17f9a556b63c4d93c070e963671937and the published repair. The broader state/infra trees include subsequent upstream changes; no whole-tree identity is claimed. The SQLite fixture does not exercise the changed agent-database/mixed-PostgreSQL paths.The released CLI also rejected
autoNameand accepted configuration after removing the key. This proves configuration/storage-owner compatibility and the configuration downgrade note; it does not claim a full updater, agent/session database upgrade, database downgrade, or released live Gateway test. No operator state or credentials were used.Immutable npm package identities
The repair retains member invalidation in the existing entity-cache owner and effect checks in existing model/REST owners; no parallel policy service, SDK export, compatibility reader, or database schema was added for this repair. The complete proposal against pinned main adds 992/deletes 9 production lines and adds 1,695/deletes 0 test lines (docs/generated outputs excluded). The retained growth implements one bounded plugin feature and its authority, persistence, and routing contracts. The previous reviewed head
79c8f2a0a682549c3dfb5f1190dcfcfe243bfacbhad fully successful CI run 38814381864; that is prior-head evidence only.Historical live Discord demonstration
On October 13, 2026, an isolated ordinary compiled Gateway at
f2b5c61988be2af10c7f6a5880790ba2f6b61c6fconnected to real Discord and a real model service. WithautoName: 2, the title stayedUntitledafter the first plain human message and changed automatically after the second. This demonstration predates later routing and policy repairs and has not been repeated on this head; current regressions cover those changes.Redacted historical observations (UTC)
Release-note context: Discord can optionally name new threads after an admitted conversation threshold. Human credit: @art22s. No release-owned changelog edit.