Skip to content

fix(line): give the agent the names LINE knows, not raw ids - #132108

Merged
obviyus merged 3 commits into
openclaw:mainfrom
edenfunf:fix/line-human-names
Aug 28, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
edenfunf:fix/line-human-names

Conversation

@edenfunf

@edenfunf edenfunf commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #132098

What Problem This Solves

In a LINE group the agent was told who was speaking with a raw user id, and which group it was in with a raw group id.

This is the envelope the model reads, from the gateway's own inbound log before this change:

preview="[LINE group:C5aeb18d690759492f1a8c391c37549a0 Sat 2026-08-29 04:46:18 GMT+8] U47f0bbc534dc503c4e4cadc86e619b63: openclaw please confirm you can see this group message"

In a group with several people the model cannot tell them apart, cannot address anyone by name, and cannot say which room it is in. The same ids reach SenderName (never set at all for LINE), GroupSubject, and ConversationLabel, so a LINE group session is also titled with its hex id — the exact outcome src/config/sessions/metadata.ts:205 warns about when it says an "old opaque route id will keep winning in UI".

Every other channel passes a name here: Telegram msg.chat.title, Feishu groupName || ctx.chatId, Nextcloud Talk roomName || roomToken, Buzz roomName, Zalo-user groupName. LINE was the only one passing an identifier.

Why This Change Was Made

The plugin already knew both names and threw them away.

getUserDisplayName was called on every single inbound message in monitor.ts, and its only consumer was the verbose log line on the very next statement. The group name was fetched too, but only once at join time to build the join-intro prompt, and then discarded.

So this moves the lookups to where the inbound context is built — the place that actually needs them — and has that log line read the resolved fact back instead of asking LINE a second time. monitor.ts and the join path both get smaller as a result, and the group-name lookup now has one owner instead of two call sites.

The sender lookup also had to change endpoint, and this is the part that is easy to get wrong. client.getProfile only answers for users who have added the bot as a friend. In a group or a room the correct calls are getGroupMemberProfile(groupId, userId) and getRoomMemberProfile(roomId, userId); using the plain endpoint returns 404 for exactly the group members whose names matter most. The conversation the message arrived in now selects the endpoint.

Both lookups are cached for five minutes through the bounded record the plugin already used for profiles, both run in parallel, and either one failing degrades to the raw id rather than failing the turn. Client construction moved inside that guard for the same reason — it resolves the account token and can throw, and an unresolvable name must never cost an inbound message.

Multi-person rooms keep their room id: LINE has no room-name API.

User Impact

The agent now sees who is speaking and where. A LINE group session is titled with the group's name instead of a hex id, and in a group the model can address people by name.

No configuration changes and no new options. If LINE cannot answer either lookup, behaviour is exactly what it is today.

The cost is one extra cached API read per uncached group conversation. The sender lookup is not new — it was already happening on every message; it is now used instead of discarded.

Production delta is +187/-76, net +111, across four files after maintainer repair. That buys correct endpoint selection per conversation type, a cached group-name owner, and two identity facts the agent never had; monitor.ts (-2) and bot-handlers.ts (-5) both shrink. I could not find a way to express it smaller without dropping the group/room endpoint distinction, which is the part that decides whether a name resolves at all.

Evidence

Live A/B against the real LINE API, same real message both times. A message sent from LINE for macOS in a real two-member group, captured at the tunnel, then replayed with its original X-Line-Signature into two gateways built from two commits. Both runs used a fresh state dir. The names below were resolved by real getGroupSummary and getGroupMemberProfile calls, not stubs.

Before (dist/.buildstamp head 28c915b239d — a build without this change):

line inbound: from=line:group:C5aeb18d690759492f1a8c391c37549a0 len=166
  preview="[LINE group:C5aeb18d690759492f1a8c391c37549a0 Sat 2026-08-29 04:46:18 GMT+8] U47f0bbc534dc503c4e4cadc86e619b63: openclaw please confirm you can see this group message"

After (dist/.buildstamp head 911ffc9d722, this PR's head):

line inbound: from=line:group:C5aeb18d690759492f1a8c391c37549a0 len=154
  preview="[LINE openclaw3 lane C test Sat 2026-08-29 04:46:18 GMT+8] <display name> (U47f0bbc534dc503c4e4cadc86e619b63): openclaw please confirm you can see this group message"

openclaw3 lane C test is the real group name. <display name> is the operator's real LINE display name, redacted here; it appeared in full in the captured log.

Both gateways ran with requireMention off for groups so the plain-text message activated a turn at all. That is a supported group setting and is orthogonal to this change — it decides whether the turn happens, not what the turn is labelled with.

Regression proof. Reverting the four production files with the tests in place:

× buildLineMessageContext > gives the agent the sender's and the group's name instead of their ids
  → expected undefined to be 'Sora'
× buildLineMessageContext > asks LINE for the sender's profile through the conversation they wrote in
  → expected "vi.fn()" to be called with arguments: [ …(2) ]
× LINE identity lookups > asks the group endpoint for a group member
  → expected undefined to be 'Sora'
× LINE identity lookups > asks the room endpoint for a room member
  → expected undefined to be 'Sora'
× LINE identity lookups > resolves a group name once and serves the rest from cache
  → sendModule.getLineGroupName is not a function
× LINE identity lookups > degrades to no group name when the summary call fails
  → sendModule.getLineGroupName is not a function

Tests  6 failed | 579 passed (585)

Restored: Test Files 39 passed (39) · Tests 585 passed (585).

The two endpoint tests fail on the assertion rather than on a missing import, which is the point — pre-fix code resolves a profile, it just asks the wrong endpoint.

Checks. node scripts/check-changed.mjs over all eight touched files: both tsgo lanes, oxfmt, extension lint, max-lines and assertion-safety ratchets, coercion-helper guard, dead-export scan, plugin boundaries, and import cycles.

A note on one test I had to change. bot-handlers.join-intro.test.ts asserted that a failed group-summary request yields a thin snapshot. With a cache in front of the lookup, a group whose name was already resolved keeps serving it through a transient failure — which is the behaviour I want, since losing a known name to a blip is worse than serving it. The test now uses a group nothing has resolved before, so it still asserts exactly what it was written to assert: when LINE will not give a name, none is invented.

Pinned SDK contract, checked at this head. extensions/line/package.json pins "@line/bot-sdk": "11.2.0", and the installed package reports 11.2.0. All three methods this change calls are declared in that exact version's client typings, node_modules/@line/bot-sdk/dist/messaging-api/api/messagingApiClient.d.ts:

376:    getGroupMemberProfile(groupId: string, userId: string): Promise<GroupUserProfileResponse>;
415:    getGroupSummary(groupId: string): Promise<GroupSummaryResponse>;
629:    getProfile(userId: string): Promise<UserProfileResponse>;
770:    getRoomMemberProfile(roomId: string, userId: string): Promise<RoomUserProfileResponse>;

GroupUserProfileResponse and RoomUserProfileResponse both carry a required displayName: string, and GroupSummaryResponse a required groupName: string, which is what the resolvers read. The tsgo extensions lane in the checks above compiles against these same typings at this head, so the calls are contract-checked rather than assumed — and the live run further up exercised all three against the real API.

Maintainer verification

  • Rebased patch-identically onto current main 5b605da389460fd035d9a2031064ed949303b14f; exact head is 3dbee0282cb0f0ba7c0dffb483280e9a5d19a177.
  • A full isolated Linux build and CLI smoke passed at both exact revisions.
  • The duplicate-display-name regression failed before the owner repair, then 61 focused tests passed. The complete LINE plugin suite passed: 39 files and 592 tests.
  • The repair names ambient group history while keeping each stable user ID, scopes profile cache entries by account and conversation, coalesces concurrent misses, and briefly caches failed lookups.
  • Final judged delta: production +189/-76 (net +113), tests +332/-20, docs +6. The growth records agent-visible identity facts and one bounded cache owner; the old monitor-only lookup was removed.
  • Live proof remains the signed real LINE group webhook replay above. The retained input and credentials were not available for a second independent replay; the pre-review full build and exact-head regression evidence cover the maintainer repair.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@edenfunf
edenfunf marked this pull request as ready for review August 28, 2026 21:05
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: line Channel integration: line size: M labels Aug 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 6:14 PM ET / 22:14 UTC.

ClawSweeper review

What this changes

The PR resolves and caches LINE sender and group display names during inbound-context construction so agents, group history, and session labels use readable identities instead of raw webhook IDs.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this active PR open for normal merge review: current main still builds LINE contexts from raw IDs, while the branch records resolved names at the inbound-context owner and retains raw-ID fallback on lookup failure. No introduced correctness or security defect was found in the reviewed change.

Priority: P2
Reviewed head: c4b34e59f0e71580038cf27e82537458336e91ab

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed LINE repair with credible real behavior proof and regression coverage; the only remaining limitation is independent local SDK declaration inspection.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The changed production owner is the LINE inbound-context finalizer, and the supplied redacted real signed webhook A/B replay shows its agent-visible output changing from group/user IDs to resolved group and sender names; final-head source retains those assignments and the supplied final-head focused tests cover the repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The changed production owner is the LINE inbound-context finalizer, and the supplied redacted real signed webhook A/B replay shows its agent-visible output changing from group/user IDs to resolved group and sender names; final-head source retains those assignments and the supplied final-head focused tests cover the repair.
Evidence reviewed 7 items Changed owner boundary: The branch resolves sender and group names in the common inbound-context finalizer, records the sender name in the envelope and context payload, and uses the group name for the conversation label and subject while retaining ID fallbacks.
Caller and downstream consumer: Accepted LINE messages call the context builder before delivery to the monitor; the generic inbound builder exposes sender name and conversation label as SenderName, ConversationLabel, and GroupSubject.
Current-main behavior remains unfixed: Current main still constructs user:&lt;id> and group:&lt;id> labels and supplies only a sender ID, so the central user problem is not already implemented there.
Findings None None.
Security None None.

How this fits together

LINE webhooks provide user, group, and room identifiers to the bundled LINE plugin. The plugin resolves those into an inbound context consumed by the agent, group-history window, logs, and session metadata.

flowchart LR
  A[LINE webhook] --> B[LINE plugin]
  B --> C[Conversation identity lookup]
  C --> D[Inbound context]
  D --> E[Agent prompt]
  D --> F[Group history]
  D --> G[Session metadata]
Loading

Before merge

  • Resolve merge risk (P1) - Independent inspection of the pinned LINE SDK declarations was unavailable in this read-only checkout because the package is absent and the promisor remote could not resolve GitHub; the supplied type-contract evidence remains uncorroborated by this reviewer.
  • Resolve merge risk (P1) - Production code grows by 111 net lines to own account- and conversation-scoped caching, endpoint selection, failure caching, and miss coalescing; source review supports that scope, but it is the main maintainability cost of the fix.
  • Complete next step (P2) - This active PR already owns the bounded repair; it needs normal maintainer merge review rather than a second repair job.
Agent review details

Security

None.

PR surface

Source +111, Tests +282, Docs +6. Total +399 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 187 76 +111
Tests 4 285 3 +282
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 478 79 +399

Review metrics

Metric Value Why it matters
Production versus test delta production +187/-76 (net +111); tests +285/-3 (net +282); docs +6 The production growth implements the cache and conversation-specific LINE endpoint selection; the accompanying tests cover the new behavior.

Stored data model

Persistent data-model change detected: persistent cache schema: extensions/line/src/send.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #132098
Summary: This PR is the explicit candidate fix for the linked report about raw LINE sender and group identifiers.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the plugin-local owner-boundary repair with its existing raw-ID fallback and bounded cache behavior, provided the normal exact-head checks pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the plugin-local owner-boundary repair with its existing raw-ID fallback and bounded cache behavior, provided the normal exact-head checks pass.

Do we have a high-confidence way to reproduce the issue?

Yes. The PR supplies a redacted real LINE group webhook A/B replay showing raw IDs before the change and display names after it, and current-main source independently shows the raw-ID construction.

Is this the best way to solve the issue?

Yes. Resolving identities in the LINE inbound-context owner lets the agent, session metadata, and group history share one cached, conversation-aware result instead of retaining a monitor-only lookup.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a79e6517be83.

Labels

Label justifications:

  • P2: The PR fixes readable identity and conversation context for LINE group turns, with limited blast radius and no evidence of an urgent availability or security regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The changed production owner is the LINE inbound-context finalizer, and the supplied redacted real signed webhook A/B replay shows its agent-visible output changing from group/user IDs to resolved group and sender names; final-head source retains those assignments and the supplied final-head focused tests cover the repair.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the LINE inbound-context finalizer, and the supplied redacted real signed webhook A/B replay shows its agent-visible output changing from group/user IDs to resolved group and sender names; final-head source retains those assignments and the supplied final-head focused tests cover the repair.

Evidence

What I checked:

  • Changed owner boundary: The branch resolves sender and group names in the common inbound-context finalizer, records the sender name in the envelope and context payload, and uses the group name for the conversation label and subject while retaining ID fallbacks. (extensions/line/src/bot-message-context.ts:281, c4b34e59f0e7)
  • Caller and downstream consumer: Accepted LINE messages call the context builder before delivery to the monitor; the generic inbound builder exposes sender name and conversation label as SenderName, ConversationLabel, and GroupSubject. (extensions/line/src/bot-handlers.ts:477, c4b34e59f0e7)
  • Current-main behavior remains unfixed: Current main still constructs user:&lt;id> and group:&lt;id> labels and supplies only a sender ID, so the central user problem is not already implemented there. (extensions/line/src/bot-message-context.ts:275, a79e6517be83)
  • Regression coverage: Focused tests cover group, room, and direct profile endpoints; per-conversation cache keys; concurrent group-name misses; failure fallback; and agent-visible context fields. (extensions/line/src/send.identity.test.ts:80, c4b34e59f0e7)
  • SDK dependency signal: The changed production code calls Messaging API profile and group-summary methods, and the owning plugin pins @line/bot-sdk 11.2.0. The checkout has no installed SDK declaration; the supplied PR evidence quotes the pinned declaration, but independent upstream inspection was unavailable because the promisor remote could not resolve GitHub. (extensions/line/package.json:11, c4b34e59f0e7)
  • Recent feature history: The current head's follow-up repair is commit c4b34e5, authored by Ayaan Zaidi, after the initial implementation commit 18db398 by xuyuanhao; both share the recorded commit timestamp. (extensions/line/src/send.ts:703, c4b34e59f0e7)

Likely related people:

  • Ayaan Zaidi: Authored the current-head follow-up that repairs the LINE identity flow and changes its central production files. (role: recent repair contributor; confidence: high; commits: c4b34e59f0e7; files: extensions/line/src/send.ts, extensions/line/src/bot-message-context.ts, extensions/line/src/bot-handlers.ts)
  • xuyuanhao: Authored the preceding implementation commit for the same LINE inbound identity behavior. (role: initial implementation contributor; confidence: medium; commits: 18db398407e5; files: extensions/line/src/send.ts, extensions/line/src/bot-message-context.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-28T21:12:59.506Z sha 911ffc9d72260ee491bebdc6cdb79e192ef8a0b1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T21:34:59.431Z sha 911ffc9d72260ee491bebdc6cdb79e192ef8a0b1 :: needs changes before merge. :: [P3] Remove the now-unused display-name wrapper

edenfunf and others added 2 commits August 28, 2026 23:55
A LINE webhook carries a user id and a group id and no names, so every
inbound turn reached the agent labelled with raw identifiers: the group
envelope prefixed each message with U47f0bb..., SenderName was never set,
and GroupSubject held the C... group id where every other channel puts a
human-readable name.

The plugin already knew how to ask. It fetched the sender's display name
on every message and spent it on one verbose log line, and it read the
group summary once at join time and then discarded it.

Both names are now resolved where the inbound context is built, cached,
and read back by that log line instead of being fetched twice. Group and
room members resolve through their own conversation, which is the only
endpoint that can see a member who has not added the bot as a friend.
Either lookup failing degrades to the raw id and never fails the turn.
@obviyus
obviyus force-pushed the fix/line-human-names branch from 911ffc9 to c4b34e5 Compare August 28, 2026 22:02
@obviyus
obviyus merged commit 62134f2 into openclaw:main Aug 28, 2026
186 checks passed
@obviyus

obviyus commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks @edenfunf!

Proof: A signed real LINE group webhook changed from raw sender and group IDs to readable names. The exact merged head also passed the 39-file, 592-test LINE suite, duplicate-name red/green coverage, exact-head CI, and local ClawSweeper review.

  • Bug: LINE gave the agent raw IDs, and ambient history could merge two people who shared a display name.
  • Fix: The LINE context owner resolves readable names, keeps each stable user ID, and reuses bounded account-scoped lookups.

Example

Before After
Sora: first and Sora: second look like one speaker Sora (user-one): first and Sora (user-two): second stay distinct

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
Resolve LINE sender and group names at the inbound context owner while retaining stable user IDs in ambient history.

Scope identity caches by account and conversation, coalesce concurrent lookups, and preserve a bounded fallback when LINE cannot resolve a name.

Co-authored-by: xuyuanhao <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Oct 15, 2026
Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. #89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve #96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from #40524.
- LINE cache eviction assumes ordinary wall-clock order. #132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 5269924/becd45325bc and 743d537 only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. f91ddef added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. #119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. #1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from #128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.
steipete added a commit that referenced this pull request Oct 15, 2026
…173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: #148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: #154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same #154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: #103695 predates #172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier #100123 TUI fixes remain, including their real #89059/#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: #159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: #121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base 9e3e16c and recorded main
a065e6a, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to #117143, with later work
  in #163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from #151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available #48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from #114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical #27189 defect belonged to the SDK replaced in #51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. #161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. #89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve #96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from #40524.
- LINE cache eviction assumes ordinary wall-clock order. #132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 5269924/becd45325bc and 743d537 only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. f91ddef added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. #119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. #1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from #128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…penclaw#173047)

* refactor(auto-reply): consolidate delivery preparation

Share aggregate collect/overflow adoption, transcript settlement and reply
sanitization. Reuse ACP account preparation, keep fixed export colors with
their CSS owner, and remove redundant runtime/cache checks. Preserve live
authorization, FIFO, consume-before-ack and ordinary write settlement.

Production: +307/-446, net 139 lines removed. Tests: +37/-83, net 46 removed.
The optional session rollover and session-event assertion cleanups were dropped
after unresolved memory-hook/background-permission proof. Their owners and the
standalone session-memory backend/tests are unchanged.

Best-effort tradeoffs accepted

- Intl constructor hot replacement after cache fill: openclaw#148648 added synthetic replacement/recovery coverage, not an incident fix; normal processes keep Intl stable. The measured formatter cache and native fallback stay; replacement takes effect after restart.
- Media application failure clearing a successful import: openclaw#154864 extracted this path, without a module-reload incident. ESM code is process-stable and the lazy loader already evicts rejected loads; raw-content fallback remains and successful imports are reused.
- Link application failure clearing a successful import: same openclaw#154864 provenance and canonical eviction owner. A successful ESM module is reused; raw-content fallback and AbortError propagation remain.
- Collect-source reinsertion after a preparation failure: openclaw#103695 predates openclaw#172080's consume-before-ack cutover. Unaccepted inputs remain queued and accepted inputs must not replay; unexplained internal queue mutation is no longer repaired here, while durable ingress retains pre-acceptance retry.
- A source abort between consecutive synchronous prepared checks: the earlier openclaw#100123 TUI fixes remain, including their real openclaw#89059/openclaw#90012 behavior. The canonical prepared assertion checks every source; Stop membership filtering and aggregate cancellation still protect actual awaits.
- Duplicate ACP post-resolution assertion: openclaw#159084 introduced async metadata ownership. Resolution still receives its owner assertion and the caller keeps the final post-await check; the private wrapper and its earlier duplicate check are gone.
- Mutation of constructor metadata bags: openclaw#121995 retained forwarding getters, but the sole production constructor call at reply-turn-admission.ts:524 supplies a fresh value literal. Those values are captured once; live session/agent/result accessors remain. The review's hypothetical retained/getter-valued constructor caller does not exist and is not a shipped SDK contract.

Evidence

Final format, changed lint, core production types, messaging test types,
line-cap and runtime cycles pass. Madge reports zero cycles; all follow-up
import specifiers are unchanged. All non-whitespace export CSS and all 40 fixed
declarations match the pinned generated stylesheet. Independent full-candidate
review completed with one source-disproved speculative P2; no accepted finding.
Completed focused selections: initial unit-fast 4 files/40 tests, HTML 3 files/29
tests, and final lint-suppressions 1 file/3 tests. ACP default-account and delivery
assertions, plus capture/hook/callback-settlement assertions, passed individually;
interrupted infra selections and remaining owner suites are incomplete.

Unresolved local failures: the retiring memory-window case timed out at 125461ms,
and the allowed background-permission completion case at 120332ms (both existing
120000ms limits). Related optional owner hunks were dropped, not claimed fixed.
An unchanged-session-owner replay was inconclusive; no main/load attribution.
No tests, timeouts, retries or skips were weakened.

Broad check-changed is incomplete. Its env inventory reported 455 against 454;
the same count was reproduced from original base d6898f3 and recorded main
51164a1, without patch-added env names or a budget edit. No hosted PR CI is
claimed: below-500 branch-only handoff for coordinator bundling.

* refactor(auto-reply): remove test-only runtime plumbing

Continue the same lane with direct owner resets instead of test-global
publications, inline the sole queue-wait scaffold, remove test-only delivery
getters, and share the immutable HTML tree and text extraction. Keep actual
login consent, interrupt authority, busy rechecks, dedupe, delivery recovery,
FIFO, transcript writes and ordinary shutdown settlement unchanged.

This follow-up removes 118 net production lines. Full branch: +341/-598,
257 net production lines removed; tests/support +84/-230, 146 net removed.
Largest-file, sole-caller, dead-export, option and compatibility sweeps found
no further sound cut without removing retained behavior or moving code.
Phase E session memory and its tests are untouched. No config, schema,
durability, retention, permission, protocol or dependency changes.

Best-effort tradeoffs accepted

- Command descriptors no longer manufacture absent optional own-undefined
  properties. The private typed builder dates to openclaw#117143, with later work
  in openclaw#163997; no production enumeration consumer exists. Property reads,
  supplied fields, defaults and JSON behavior remain unchanged.
- HTML entries are immutable for the lifetime of an export viewer. Build
  its tree/index once; external mutation of this private snapshot is not
  supported. Keep the iterative long-session fix from openclaw#151029.

Evidence

Fresh isolated full-branch review is scoped-clean through P2. Changed lint,
format, core types, messaging/root-tooling test types, line cap and runtime
cycles pass (0 runtime value cycles). The initial test-type invocation used
an invalid canonical graph selector; the corrected supported commands pass.
No new production runtime import edges; prior zero-cycle Madge proof applies.

Focused proof passes: 15 files/318 tests across four shards, 1629.71s total
including 382.56s worker preparation. Final-outcome/HTML: 4 files/45 tests;
ingress retry: 1 file/6 tests; required lint-suppressions: 1 file/3 tests;
auto-reply owners: 9 files/264 tests. Consent fixtures emitted host-broker
metadata-write warnings; all assertions passed. All proof used isolated
HOME/OpenClaw/XDG state, never real user state.

Earlier memory-window and background-permission timeouts remain unresolved;
their optional owner hunks were dropped, not claimed fixed. Broad changed
check remains incomplete, including the baseline-reproduced env inventory
455/454 finding. No tests, timeouts, retries, skips or budgets were weakened.
Below-500 branch-only handoff; no PR or hosted CI is claimed.

* refactor(channels): consolidate secondary transport plumbing

Use existing SDK setup and sleep owners, reuse parsed Tlon list items,
consolidate LINE callback validation and Teams sender selection, replace
iMessage's parallel cache indices, and remove redundant QA snapshots.
Preserve account, security, conversation, transport and settlement contracts.

Best-effort tradeoffs accepted:
- Feishu identity published before successor route registration during an old
  webhook drain may be cleared until refresh/restart. Available openclaw#48588 evidence
  only forces that identity interleaving in a test, with no cited human report;
  registered successors, signed ingress and response settlement remain protected.
- QA senders that mutate already-sanitized internal tool records no longer
  receive independent deep-snapshot comparison. Native records only append;
  the mutation tests from openclaw#114910 monkeypatch a sender. Duplicate final
  suppression and pre-await tool-array capture remain.
- Retired Bot Framework revoked proxies no longer trigger proactive resend.
  The historical openclaw#27189 defect belonged to the SDK replaced in openclaw#51808;
  current Teams ActivityContext is not a revocable proxy. Unexpected errors
  now follow the ordinary delivery-error path, without duplicate fallback.
- The bounded self-chat cache uses linear lookup instead of synchronized
  indices. openclaw#161967 establishes no measured lookup-performance requirement;
  existing TTL, cap, timestamp, scope and hash matching remain unchanged.

No config, protocol, dependency, schema, durability, retention, permission or
public SDK contract changes. Phase E memory backend is untouched.

Net production: 246 lines removed (83 added, 329 deleted), excluding tests,
support and inventories. Fresh review through P2 is clean; production/test
extension types and both cycle checks pass (zero cycles). X focused suites
pass 31 tests; native Buzz baseline/current protocol probes preserve signed
discovery, cancellation and notification-driven retry. Other direct owner
probes cover Tlon, self-chat caching, LINE limits and Mattermost setup.

Local proof gaps: SDK declaration preparation timed out before lint; the
remaining owner suites produced no assertions during loaded-host startup;
full check-changed was classified but not run. The suppression test has
unrelated UI-only allowlist drift inherited from the base. No new suppression,
timeout increase, retry, skip or baseline expansion.

* refactor(channels): simplify account-scoped transport owners

Use the existing account registry as Twitch's only account owner, fold the
private Teams store selector into its only caller, share QA message sending,
and remove redundant Feishu table/cache and mobile expiry work. Convert
replacement table-cell Markdown before deleting its existing content.

Best-effort tradeoffs accepted:
- Feishu optional bot-name failures use one 60-second account cooldown, not
  ten failures plus an hour-long circuit. openclaw#89783 documents feature proof,
  not a human incident needing that circuit. Names recover next minute.
- Unsupported runtimes without Intl.Segmenter now fail clearly; supported
  Node/current Bun preserve openclaw#96587's real grapheme/emoji repair.
- Malformed duplicate Feishu block IDs retain source/current-table order,
  not redundant map/sort or first-match order. Valid provider trees retain
  the tree reconstruction and table-width behavior from openclaw#40524.
- LINE cache eviction assumes ordinary wall-clock order. openclaw#132108's real
  account identity fix remains; backward clock jumps may evict another
  display-name entry, which is refetched normally.
- iMessage/Zalouser internal expiries trust Date.now plus constant TTLs.
  Direct commits 3bcf53d/233d19aff94 and 2bf2afc only test NaN,
  Infinity or year-275760 clocks, not human reports. Monkeypatched invalid
  clocks may keep cached verdicts/metadata until restart.
- Zalo's duplicate expiry preflight is gone; the shared hosted-media owner
  still rejects before download. 2512ef2 added only synthetic clock
  handling; an invalid clock now receives that owner's generic error.
- FaceTime cancels synchronous drain timers rather than fencing them with
  generations. openclaw#119291 cites no stale-timer incident; barge-in, carrier
  authority, playback timing and shutdown settlement remain.
- Private Twitch managers serve one registered account, not arbitrary
  additional username/channel pairs. openclaw#1612 introduced unused inner maps;
  production managers already belong to one account. Real startup
  cancellation and connection sharing from openclaw#128909 remain.

No config, protocol, dependency, schema, retention, permission or public SDK
changes. Phase E memory is untouched. The attempted vendor-type consolidation
was fully dropped because the pinned ZCA package cannot expose its public
types under NodeNext without an approval-gated dependency/configuration fix.

Reopened pass: 183 additional net production lines removed; branch total429
(176 added/605 deleted), excluding tests/support/generated/declarations.
Production/test extension types, runtime/Madge zero-cycle checks, formatting
and actual Tlon/long-sleep owner probes pass. Fresh P2 review has three
source-disproved findings and no accepted/actionable finding. Two mocked
constructor lint errors were mechanically fixed and their narrow guard passes.
Owner suites remained startup-bound and were stopped before assertions;
the docx regression/control remains unproved. Suppression suite retains only
the known base UI allowlist drift. Full package-aware lint/check-changed and
exact bundle-head CI remain for coordinator bundling. No structural PR.

* test: repair wave-5 bundle integration checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LINE tells the agent who is speaking with a raw user id, and which group with a raw group id

2 participants