Skip to content

fix(msteams): reset sessions on app removal lifecycle#104690

Open
jimmypuckett wants to merge 38 commits into
openclaw:mainfrom
jimmypuckett:codex/msteams-lifecycle-session-reset-99054
Open

fix(msteams): reset sessions on app removal lifecycle#104690
jimmypuckett wants to merge 38 commits into
openclaw:mainfrom
jimmypuckett:codex/msteams-lifecycle-session-reset-99054

Conversation

@jimmypuckett

Copy link
Copy Markdown
Contributor

Closes #99054

What Problem This Solves

Fixes an issue where Microsoft Teams users who remove a personal app/bot and later add it again can continue the same OpenClaw server-side DM session, allowing the bot to use prior conversation context after an app lifecycle boundary.

This targets Teams app-management lifecycle signals that the bot can actually observe. Live capture showed Teams' local "Remove chat history" action can arrive later as an ordinary message in the same personal conversation.id, with no installationUpdate, conversationUpdate, membersAdded, or membersRemoved activity. This PR does not claim to detect that fully local clear-chat action when Teams gives the bot no lifecycle or conversation-boundary signal.

Why This Change Was Made

Teams now routes installationUpdate removal activities and bot membersRemoved conversation updates into a lifecycle handler. On a removal boundary, the handler removes the cached Teams conversation reference, rotates the matching OpenClaw session entry to a new session id with updatedAt: 0, and clears provider-owned route/delivery/origin metadata so the next inbound message cannot resume the removed chat transcript.

The handler also treats a personal installationUpdate action=add as a reinstall boundary only when an existing route-matched Teams DM session is already active. That catches tenants or flows where the re-add signal is visible but the prior remove signal was missed, without resetting first-time installs. Finally, inbound personal DMs check for a stored same-user/same-bot conversation reference with a different Teams conversation.id; when Teams exposes that boundary, OpenClaw removes the previous reference and rotates the DM session.

User Impact

After a true Teams app removal and re-add, the next inbound message starts from a fresh OpenClaw session instead of silently resuming prior DM or channel context. Operators also avoid retaining a cached proactive-send reference for the removed Teams conversation.

For Teams clear-chat/reopen flows, the patch protects the observable case where Teams gives the bot a new personal conversation id. If Teams reuses the same server-side conversation id and sends no lifecycle event, there is no bot-visible signal in the captured payloads; that remains a Teams platform limitation rather than a claim made by this PR.

Existing welcome-card behavior, normal messages, reactions, and unrelated lifecycle events are unchanged.

Evidence

  • Live corrected Dale smoke:
    • Baseline before app removal used a synthetic marker.
    • Teams app removal emitted installationUpdate action=remove.
    • Handler logged msteams lifecycle remove handled, reason=installation-remove, conversationType=personal, conversationRemoved=true, sessionsReset=1.
    • The session entry rotated to a new redacted session id with updatedAt: 0 and no Teams route/delivery/origin metadata.
    • After re-add, Teams showed the welcome card and the verification prompt used a fresh session; the bot did not recall the pre-removal marker.
  • Live Teams Remove chat history follow-up after deploying this branch:
    • Sent a synthetic pre-clear marker.
    • Used Teams Remove chat history, opened the app/chat again, and sent a verification prompt.
    • No installationUpdate add, lifecycle/remove activity, or DM conversation-boundary handler log appeared.
    • The same OpenClaw session id remained active, and the bot could recall the pre-clear marker.
    • This confirms the PR should not claim to fix Teams local clear-history behavior when Teams sends no lifecycle event and reuses the same server-side conversation id.
  • Added regression coverage for:
    • personal installationUpdate/remove
    • personal installationUpdate/remove-upgrade
    • first-install installationUpdate/add with no active session
    • personal installationUpdate/add when an existing session is active
    • ignored channel installationUpdate/add
    • channel bot membersRemoved
    • ignored non-bot membersRemoved
    • race-safe session rotation
    • personal DM conversation-id boundary rotation
    • no rotation for matching personal conversation ids
    • no rotation for different stored bot ids
  • Added monitor-level coverage proving the Teams activity shim dispatches installationUpdate and membersRemoved activities to registered lifecycle handlers.
  • Validation:
    • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts - 11 tests passed.
    • pnpm test extensions/msteams/src/monitor-handler/message-handler.authz.test.ts - 18 tests passed.
    • pnpm test extensions/msteams - 71 files passed, 1007 tests passed.
    • pnpm run lint:extensions:bundled - passed.
    • pnpm format:check extensions/msteams/src/monitor-handler/lifecycle-handler.ts extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts extensions/msteams/src/monitor-handler/message-handler.ts - passed.
    • git diff --check - passed.

Migration note: This PR replaces #100371 with the same published head commit, moved from spinen/openclaw to jimmypuckett/openclaw so OpenClaw maintainers and repository automation can update the contribution without transferring authorship. Prior review, proof, and CI history remain available on #100371.

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: XL labels Jul 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 9:51 PM ET / July 20, 2026, 01:51 UTC.

Summary
Adds Microsoft Teams uninstall/reinstall lifecycle handling that rotates affected personal-chat sessions, plus a scoped Plugin SDK lifecycle-reset API with locked-harness owner handoff.

PR surface: Source +950, Tests +1098, Docs +4, Generated 0, Other +2. Total +2054 across 25 files.

Reproducibility: no. high-confidence current-main reproduction was run in this review. The pre-fix path is source-reproducible and the PR provides a concrete live Teams removal/re-add observation, but confirming the current-main failure still requires a real Teams deployment.

Review metrics: 1 noteworthy metric.

  • Public Plugin SDK lifecycle APIs: 1 added. The new reset primitive expands the stable plugin-facing session contract and therefore needs explicit owner approval.

Stored data model
Persistent data-model change detected: migration/backfill/repair: extensions/msteams/src/monitor-handler/lifecycle-handler.ts, serialized state: src/plugin-sdk/session-store-access-scope.ts, serialized state: src/plugin-sdk/session-store-lifecycle-runtime.test.ts, serialized state: src/plugin-sdk/session-store-lifecycle-runtime.ts, serialized state: src/plugin-sdk/session-store-runtime.ts, unknown-data-model-change: src/plugin-sdk/session-store-lifecycle-runtime.test.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99054
Summary: This PR is the active candidate implementation for the canonical Teams app-removal session-retention report; the earlier replacement PR is closed unmerged.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Obtain explicit plugin/session-owner approval for the public lifecycle-reset and locked-harness handoff contract.

Risk before merge

  • [P1] Merging creates a public Plugin SDK lifecycle-reset API whose callback, reservation, rollback, and expected-revision semantics become an upgrade-sensitive contract for external plugins.
  • [P1] Locked harness sessions now depend on owner-coordinated physical-runtime release before persisted session rotation; maintainers should confirm this is the intended generic ownership model rather than a Teams-specific exception.

Maintainer options:

  1. Confirm the stable lifecycle-reset contract (recommended)
    Before merge, have plugin and session owners explicitly accept the public API, expected-revision behavior, rollback semantics, and locked-harness release ordering.
  2. Constrain the repair to an existing owner seam
    If a public generic contract is not desired, rework the Teams lifecycle repair so it does not add a parallel session-mutation API.

Next step before merge

  • [P2] The remaining blocker is a maintainer contract decision, not a narrow mechanical repair that an automated fix lane can safely make.

Maintainer decision needed

  • Question: Should OpenClaw expose resetSessionEntryLifecycle as a stable public Plugin SDK/session-ownership contract, including locked-harness reset handoff, to support observable channel lifecycle boundaries?
  • Rationale: The patch is mechanically coherent, but choosing a permanent public cross-plugin API and its harness-owner responsibilities is a product and architecture decision that tests cannot settle.
  • Likely owner: steipete — Recent Msteams and channel-boundary history makes this the best available owner candidate for the API-boundary decision.
  • Options:
    • Approve the narrow generic seam (recommended): Accept the documented lifecycle-reset API as a stable generic primitive, with the existing ownership checks and locked-harness handoff contract.
    • Keep the capability owner-local: Avoid expanding the public SDK and require a narrower Msteams-specific or existing-owner integration path before landing.
    • Pause for contract design: Defer this PR until session and plugin owners define the supported lifecycle-reset API and compatibility guarantees.

Security
Cleared: No concrete security or supply-chain regression was found in the proposed source, documentation, and API-baseline changes.

Review details

Best possible solution:

Keep one generic, documented lifecycle-reset primitive only if plugin and session owners explicitly accept it as the stable cross-plugin contract; otherwise redesign the Teams repair behind an existing owner-local seam.

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

No high-confidence current-main reproduction was run in this review. The pre-fix path is source-reproducible and the PR provides a concrete live Teams removal/re-add observation, but confirming the current-main failure still requires a real Teams deployment.

Is this the best way to solve the issue?

Unclear. The Teams behavior is a focused repair, but exposing a new public lifecycle-reset and harness-owner contract is only the best solution if owners want that generic Plugin SDK capability.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The PR addresses retained conversation context across a real Teams app removal/re-add boundary, with privacy and session-state impact for affected users.
  • merge-risk: 🚨 compatibility: A new public Plugin SDK session API and documented harness handoff become compatibility commitments for plugin authors.
  • merge-risk: 🚨 session-state: The patch rotates persisted session identity and transcript ownership, so an incorrect contract decision could affect active-session continuity.
  • 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 PR body supplies after-fix live Teams removal/re-add evidence with lifecycle logs and a fresh-session result, while accurately documenting the unsupported no-signal clear-history case.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies after-fix live Teams removal/re-add evidence with lifecycle logs and a fresh-session result, while accurately documenting the unsupported no-signal clear-history case.
Evidence reviewed

PR surface:

Source +950, Tests +1098, Docs +4, Generated 0, Other +2. Total +2054 across 25 files.

View PR surface stats
Area Files Added Removed Net
Source 15 1115 165 +950
Tests 6 1151 53 +1098
Docs 2 5 1 +4
Config 0 0 0 0
Generated 1 1 1 0
Other 1 4 2 +2
Total 25 2276 222 +2054

What I checked:

  • Teams lifecycle entry points: The branch registers both membersRemoved and installationUpdate handlers and routes them through the lifecycle reset handler, covering the observable removal signals described in the linked bug report. (extensions/msteams/src/monitor-handler.ts:255, 29ddd9bb487b)
  • Atomic generic reset seam: The branch exposes resetSessionEntryLifecycle through the public session-store runtime, making this a lasting Plugin SDK capability rather than an Msteams-local implementation detail. (src/plugin-sdk/session-store-runtime.ts:456, 29ddd9bb487b)
  • Locked-harness ownership boundary: The registry wrapper checks stored-session ownership and coordinates a harness reset before publishing the rotated session, so the proposed API affects plugin ownership and active runtime lifecycle contracts. (src/plugins/registry-runtime-session-policy.ts:1, 29ddd9bb487b)
  • Observed after-fix behavior: The PR body records a live Teams removal/re-add run where installationUpdate action=remove triggered one session reset and the next message used fresh context; it also explicitly bounds the unsupported same-conversation-id clear-history case. (29ddd9bb487b)
  • Current review continuity: The prior completed review cycle found no remaining line-level defect after the session-mutation guards were restored, and identified the same unresolved public lifecycle-reset contract as the remaining blocker. (src/plugins/registry-runtime.ts:651, 1c7d113387ce)
  • Likely area provenance: Recent merged Microsoft Teams boundary work includes the Msteams test-seam refactor, while this branch also contains a focused personal-chat scoping commit by the same area contributor. (extensions/msteams/src/monitor-handler.ts:255, 6d3eff97a0d5)

Likely related people:

  • steipete: Merged recent Msteams boundary work and authored the branch commit that narrows lifecycle resets to personal chats, making them the strongest available routing candidate for the channel and contract boundary. (role: recent area contributor; confidence: medium; commits: 6d3eff97a0d5, c8c1f9ef9606; files: extensions/msteams/src/monitor-handler.ts, extensions/msteams/src/monitor-handler/lifecycle-handler.ts, src/plugins/registry-runtime.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (48 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-14T23:46:18.763Z sha 05f49dc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T00:04:39.689Z sha 05f49dc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T00:24:10.149Z sha 05f49dc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-15T01:01:52.716Z sha 05f49dc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T12:52:19.037Z sha 4f9f6d0 :: found issues before merge. :: [P1] Preserve branch and rewind session mutation guards
  • reviewed 2026-07-19T14:55:23.068Z sha 7894da1 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T15:37:38.677Z sha 7894da1 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-19T19:00:22.166Z sha 6da7922 :: needs maintainer review before merge. :: none

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Updated this PR branch to address ClawSweeper's author action on the published personal-fork PR head.

What changed:

  • Cherry-picked fix(msteams): rotate stale provider-bound lifecycle sessions onto the published PR branch.
  • Cherry-picked the follow-up lifecycle rotation refinement/assertions.
  • Merged current upstream/main into the PR branch so the head is based on current main.

The blocker is addressed by rotating matching Teams lifecycle entries even when updatedAt is already 0 if Teams provider binding metadata remains, while clean zero-timestamp tombstones remain idempotent.

Local validation on 50f434b090a:

  • git diff --check upstream/main...HEAD
  • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts — 13 passed
  • pnpm test extensions/msteams — 76 files, 1111 tests passed
  • pnpm run lint:extensions:bundled
  • pnpm run lint:extensions:channels — passed; no extension channel files found
  • pnpm lint --threads=8

I will wait for GitHub CI on this pushed head before requesting ClawSweeper re-review.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Refreshed this PR branch again because upstream/main moved after the previous update.

New pushed head: a44181ebe33

What changed in this refresh:

  • Merged current upstream/main (1c576a27131) into the PR branch.
  • No merge conflicts.
  • Verified the PR diff remains scoped to the same 8 Microsoft Teams lifecycle files.

Local validation on a44181ebe33:

  • git diff --check upstream/main...HEAD
  • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts — 13 passed
  • pnpm test extensions/msteams — 76 files, 1111 tests passed
  • pnpm run lint:extensions:bundled
  • pnpm run lint:extensions:channels — passed; no extension channel files found
  • pnpm lint --threads=8

I will wait for GitHub CI on this refreshed head before requesting another ClawSweeper re-review if needed.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jul 11, 2026
@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Addressed ClawSweeper's current P1 author action on exact head a44181ebe33.

New pushed head: c2cc65ba7de

What changed:

  • Lifecycle reset now preserves durable user-controlled session preferences by spreading the current entry before replacing sessionId and marking updatedAt: 0.
  • It explicitly clears stale transcript/runtime state and Teams-owned route/delivery/origin bindings.
  • Added regression assertions showing model/provider/reasoning/verbosity/TTS preferences are preserved while transcript, token, compaction, delivery, and Teams binding fields are removed.

Local validation:

  • git diff --check upstream/main...HEAD
  • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts — 13 passed
  • pnpm test extensions/msteams — 76 files, 1111 tests passed
  • pnpm run lint:extensions:bundled
  • pnpm run lint:extensions:channels — passed; no extension channel files found
  • pnpm lint --threads=8

I will wait for GitHub CI on c2cc65ba7de before requesting ClawSweeper re-review.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Fixed the two exact-head CI failures from c2cc65ba7de.

New pushed head: ef4e1e9844e

Root cause:

  • check-prod-types and check-additional-extension-package-boundary both hit the lifecycle reset helper's loose return type.
  • The helper returned the local candidate shape with unknown fields, which was not assignable to the SDK session entry patch type.

Fix:

  • Made createMSTeamsLifecycleResetEntry generic so it returns the same concrete entry type it receives.
  • This keeps the SDK SessionEntry shape intact while still preserving preferences and clearing lifecycle-sensitive fields.

Local verification:

  • pnpm run test:extensions:package-boundary:compile
  • pnpm run test:extensions:package-boundary:canary
  • pnpm tsgo:prod
  • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts — 13 passed
  • pnpm run lint:extensions:bundled
  • git diff --check upstream/main...HEAD

I will wait for GitHub CI on ef4e1e9844e before requesting ClawSweeper re-review.

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 11, 2026
@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Addressed ClawSweeper's current P1 on exact head ef4e1e9844e.

New pushed head: 70699eab681

What changed:

  • Teams lifecycle reset now clears stale run/status timing fields during session rotation:
    • status
    • startedAt
    • endedAt
    • runtimeMs
    • lastInteractionAt
  • Added focused lifecycle-handler assertions proving these fields are cleared while durable preferences remain preserved.

Local validation:

  • pnpm test extensions/msteams/src/monitor-handler/lifecycle-handler.test.ts — 13 passed
  • pnpm test extensions/msteams — 76 files, 1111 tests passed
  • pnpm tsgo:prod
  • pnpm run test:extensions:package-boundary:compile
  • pnpm run test:extensions:package-boundary:canary
  • pnpm run lint:extensions:bundled
  • git diff --check upstream/main...HEAD

I will wait for GitHub CI on 70699eab681 before requesting ClawSweeper re-review.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head validation for 1c7d113387ce93f687a402a4d8d5480834218cd6 is complete.

  • GitHub CI: 86 passed, 0 failed, 0 pending (29 skipped, 1 neutral)
  • Restored ownership guards for sessions.branches.switch, sessions.rewind, and sessions.fork
  • Focused registry ownership regression: 9 tests passed
  • pnpm check:test-types
  • pnpm lint --threads=8
  • targeted oxlint
  • pnpm format:check
  • pnpm check:max-lines-ratchet --base upstream/main
  • pnpm plugin-sdk:api:check
  • Effective PR diff remains exactly 25 scoped files; no CHANGELOG.md or unrelated paths

This addresses ClawSweeper's concrete P1 session-mutation guard finding. The remaining item is the maintainer decision on the public lifecycle-reset and locked-harness handoff contract.

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

Copy link
Copy Markdown
Contributor Author

Exact-head validation for 7894da1a34cb629877d1934e2c7ca1814102495b is complete.

  • GitHub CI: 86 passed, 0 failed, 0 pending (29 skipped, 1 neutral)
  • Focused Teams / Plugin SDK / plugin runtime suites: 99 tests passed
  • pnpm check:test-types
  • pnpm plugin-sdk:api:check
  • pnpm test:extensions:package-boundary
  • pnpm lint --threads=8
  • pnpm format:check
  • pnpm check:max-lines-ratchet --base upstream/main
  • Effective PR diff: exactly 25 scoped files, including the generated API baseline; no CHANGELOG.md or unrelated paths

The restored ownership guards for sessions.branches.switch, sessions.rewind, and sessions.fork remain covered. ClawSweeper already has an active exact-head review lease for this SHA, so I am not posting another trigger.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 19, 2026
@jimmypuckett

jimmypuckett commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI status for 6da7922deace96cb624676c7b16659de75eb5243:

  • Failing check: checks-node-compact-small-7 in run 29699626329
  • Concrete failure: src/cli/help-exit.process.test.ts timed out after 30 seconds for openclaw --help; the shard otherwise completed 3,157 passing tests
  • Ownership: PR fix(msteams): reset sessions on app removal lifecycle #104690 does not modify src/cli/help-exit.process.test.ts or the CLI help implementation; its effective diff remains the same 25 Teams / session lifecycle / Plugin SDK files
  • Exact local reproduction: pnpm test src/cli/help-exit.process.test.ts passes 13/13 in 21.25 seconds

This is a transient runner timeout outside the contribution diff. I attempted a failed-job-only rerun, but GitHub requires repository admin rights for this workflow. No unrelated CLI change is being added to this PR.

@jimmypuckett

jimmypuckett commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI status for 29ddd9bb487b9eab7f446108930b3767515e9d1b:

  • Failing check: checks-node-compact-small-6 in run 29708662652
  • Concrete failure: src/process/child-process.test.ts expected delayed descendant output TAIL, but observed only HEAD; the affected process lane otherwise completed 621 passing tests
  • Ownership: PR fix(msteams): reset sessions on app removal lifecycle #104690 modifies neither src/process/child-process.test.ts nor src/process/child-process.ts; its effective diff remains the same 25 scoped Teams / session lifecycle / Plugin SDK files
  • Exact local reproduction: pnpm test src/process/child-process.test.ts passes 3/3 in 3.29 seconds

This is a timing-sensitive process test outside the contribution diff. Two failed-job-only rerun attempts were also blocked by transient GitHub Actions API 503 responses. No unrelated process change is being added to this PR.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Exact-head validation for e7e920ab1be9c83f278035690feb0035f8c20ca4 is complete.

  • GitHub CI: 86 passed, 0 failed, 0 pending (30 skipped)
  • Focused Teams / Plugin SDK / plugin runtime regressions: 82 tests passed
  • Previously flaky CI reproductions: 21 tests passed (src/process/child-process.test.ts 3/3; src/cli/help-exit.process.test.ts 18/18)
  • pnpm check:test-types
  • pnpm plugin-sdk:api:check
  • pnpm test:extensions:package-boundary
  • pnpm lint --threads=8
  • pnpm format:check
  • pnpm check:max-lines-ratchet --base upstream/main
  • Effective PR diff: exactly 25 scoped files; no CHANGELOG.md or unrelated paths

The merge preserves upstream's settled-turn Plugin SDK exports plus this PR's resetSessionEntryLifecycle export. ClawSweeper already auto-started an exact-head review lease, so no duplicate re-review trigger is being posted.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Exact-head validation for 9c758ae705beb541ffe1d2946bde061d38b1ed29 is complete.

  • GitHub CI: 86 passed, 0 failed, 0 pending (30 skipped/neutral)
  • Focused Teams / Plugin SDK / plugin runtime regressions: 82 tests passed
  • Previously flaky CI reproductions: 21 tests passed (src/process/child-process.test.ts 3/3; src/cli/help-exit.process.test.ts 18/18)
  • pnpm check:test-types
  • pnpm plugin-sdk:api:check
  • pnpm test:extensions:package-boundary (124 plugins + 2 canaries)
  • pnpm lint --threads=8
  • pnpm run lint:extensions
  • pnpm format:check
  • pnpm check:max-lines-ratchet --base upstream/main
  • Effective PR diff: exactly 25 scoped files; no CHANGELOG.md or unrelated paths

The merge preserves upstream's current Plugin SDK setup surfaces while retaining the public resetSessionEntryLifecycle export and its generated API baseline.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Exact-head CI status for eff83be2842b89174a12c2e7862a5cbef50ca41e:

  • Failing check: checks-node-compact-large-5 in run 29966644976
  • Concrete failure: src/system-agent/tui-backend.test.ts timed out after 120 seconds in runs OpenClaw inside the shared TUI shell; the shard otherwise completed 1,164 passing tests.
  • Ownership: PR fix(msteams): reset sessions on app removal lifecycle #104690 does not modify src/system-agent/tui-backend.test.ts, its system-agent implementation, or its TUI harness. The effective diff remains the same 25 Teams lifecycle/session-reset and Plugin SDK files.
  • Exact local reproduction: pnpm test src/system-agent/tui-backend.test.ts passes 9/9 in 55.86 seconds.

This is a timing-sensitive upstream CI failure. No unrelated system-agent or TUI change is being added to this PR.

…neage-20260713

# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline.sha256
#	scripts/plugin-sdk-surface-report.mjs
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(msteams): reset sessions on app removal lifecycle This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@jimmypuckett

Copy link
Copy Markdown
Contributor Author

Exact head 0622029: CI is otherwise complete, but security-fast fails its production-dependency audit on upstream's brace-expansion advisory GHSA-mh99-v99m-4gvg (range <=5.0.7). This PR does not modify package manifests or pnpm-lock.yaml, so there is no scoped branch repair to apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

[Bug]: Teams app removal/re-add retains prior DM session history

2 participants