Skip to content

[codex] Add Teams member-info action gate#78839

Draft
IKANISA1 wants to merge 1 commit into
openclaw:mainfrom
IKANISA1:codex/teams-member-info-action-gate
Draft

[codex] Add Teams member-info action gate#78839
IKANISA1 wants to merge 1 commit into
openclaw:mainfrom
IKANISA1:codex/teams-member-info-action-gate

Conversation

@IKANISA1

@IKANISA1 IKANISA1 commented May 7, 2026

Copy link
Copy Markdown

Summary

Adds explicit config support for channels.msteams.actions.memberInfo and wires the Microsoft Teams member-info message action through the existing action-gate pattern. When disabled, the action is hidden from message-tool discovery and direct calls return a clear disabled error.

Why

The Teams documentation already documents channels.msteams.actions.memberInfo, but the runtime config schema and message action surface did not expose or enforce that gate.

Real behavior proof

  • Behavior or issue addressed: Microsoft Teams now honors channels.msteams.actions.memberInfo=false in the real message-tool discovery and action dispatch path, matching the documented config key.

  • Real environment tested: Local OpenClaw source checkout on macOS, Node with tsx, using the patched Microsoft Teams plugin/config code in this branch.

  • Exact steps or command run after this patch: Ran this command from the repository root after the patch:

    node --import tsx --input-type=module <<'EOF'
    import { msteamsPlugin } from "./extensions/msteams/channel-plugin-api.ts";
    import { MSTeamsConfigSchema } from "./src/config/zod-schema.providers-core.ts";
    
    const cfg = {
      channels: {
        msteams: {
          appId: "app-id",
          appPassword: "secret",
          tenantId: "tenant-id",
          actions: { memberInfo: false },
        },
      },
    };
    const parsed = MSTeamsConfigSchema.safeParse({ actions: { memberInfo: false } });
    const actions = msteamsPlugin.actions?.describeMessageTool?.({ cfg })?.actions ?? [];
    const result = await msteamsPlugin.actions?.handleAction?.({
      channel: "msteams",
      action: "member-info",
      cfg,
      params: { userId: "user-1" },
    });
    console.log(JSON.stringify({
      schemaAccepted: parsed.success,
      parsedActions: parsed.success ? parsed.data.actions : null,
      advertisedMemberInfo: actions.includes("member-info"),
      advertisedStillIncludesUploadFile: actions.includes("upload-file"),
      disabledActionResult: result,
    }, null, 2));
    EOF
  • Evidence after fix: Terminal output from the command above:

    {
      "schemaAccepted": true,
      "parsedActions": {
        "memberInfo": false
      },
      "advertisedMemberInfo": false,
      "advertisedStillIncludesUploadFile": true,
      "disabledActionResult": {
        "isError": true,
        "content": [
          {
            "type": "text",
            "text": "member-info is disabled via channels.msteams.actions.memberInfo=false."
          }
        ],
        "details": {
          "error": "member-info is disabled via channels.msteams.actions.memberInfo=false."
        }
      }
    }
  • Observed result after fix: The config schema accepts actions.memberInfo=false; member-info is no longer advertised by the Teams message tool when disabled; other Teams actions such as upload-file remain advertised; and direct member-info calls return the explicit disabled-action error without invoking the runtime member lookup.

  • What was not tested: Tenant-level Teams webhook delivery, Microsoft Graph member lookup against a real tenant, and Azure/manifest deployment were not exercised in this proof because this patch gates local config validation, tool discovery, and action dispatch behavior.

Validation

  • pnpm test:extension msteams
  • pnpm config:channels:check
  • pnpm tsgo:extensions:test
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/msteams/src/channel.ts extensions/msteams/src/channel.test.ts extensions/msteams/src/channel.actions.test.ts

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 7, 2026
@clawsweeper

clawsweeper Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 5:05 PM ET / 21:05 UTC.

Summary
The PR adds channels.msteams.actions.memberInfo schema/types/generated metadata and gates Microsoft Teams member-info discovery and dispatch through the existing action-gate helper.

PR surface: Source +26, Tests +45, Generated +1. Total +72 across 6 files.

Reproducibility: yes. Source inspection reproduces the mismatch: current docs advertise channels.msteams.actions.memberInfo, while current main lacks that Teams schema field and always advertises/dispatches member-info.

Review metrics: 1 noteworthy metric.

  • Teams action config surface: 1 added, 0 changed, 0 removed. The PR adds one documented Teams config key, so maintainers should verify schema, generated metadata, runtime behavior, and upgrade compatibility stay aligned before merge.

Stored data model
Persistent data-model change detected: unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
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:

  • Refresh the branch against current main and rerun focused Teams config/action checks.

Risk before merge

  • [P1] GitHub currently reports the PR as draft and conflicting, so maintainers need a refreshed merge result before landing.
  • [P1] Conflict resolution is compatibility-sensitive because current main has Teams cloud and serviceUrl schema/type behavior that is absent from the PR head's older base.
  • [P1] The added Teams config surface needs schema, types, generated metadata, discovery, dispatch, and focused tests kept aligned after refresh.

Maintainer options:

  1. Refresh and preserve Teams config (recommended)
    Resolve the branch against current main while keeping the newer Teams cloud and serviceUrl config fields, then rerun focused Teams config/action validation.
  2. Pause until a clean merge result exists
    Keep the useful PR open but avoid merging or approving while GitHub reports the branch as draft and conflicting.

Next step before merge

  • [P2] Human review is needed because the branch is draft/conflicting and conflict resolution must preserve current Teams cloud and serviceUrl config behavior.

Security
Cleared: No concrete security or supply-chain concern found; the diff gates an existing Graph-backed Teams action and does not add dependencies, workflows, secrets handling, or external code execution.

Review details

Best possible solution:

Land a refreshed branch that preserves current Teams cloud and serviceUrl behavior while adding the documented memberInfo gate across schema, generated metadata, discovery, dispatch, and tests.

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

Yes. Source inspection reproduces the mismatch: current docs advertise channels.msteams.actions.memberInfo, while current main lacks that Teams schema field and always advertises/dispatches member-info.

Is this the best way to solve the issue?

Yes, pending branch refresh. Reusing createActionGate in Teams discovery and direct dispatch is the narrow owner-boundary fix; the safer pre-merge path is to preserve newer Teams cloud and serviceUrl behavior while rebasing.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a narrow Microsoft Teams config/runtime mismatch with limited blast radius, but it affects a documented action gate.
  • merge-risk: 🚨 compatibility: The PR adds a Teams config surface on a conflicting branch, and conflict resolution could drop newer cloud or serviceUrl behavior from current main.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from a patched checkout exercising schema parsing, message-tool discovery, and disabled direct dispatch for the Teams member-info gate.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from a patched checkout exercising schema parsing, message-tool discovery, and disabled direct dispatch for the Teams member-info gate.
Evidence reviewed

PR surface:

Source +26, Tests +45, Generated +1. Total +72 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 47 21 +26
Tests 2 45 0 +45
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 9 8 +1
Other 0 0 0 0
Total 6 101 29 +72

What I checked:

  • AGENTS.md policy read: Root policy and the scoped extensions guide were read fully; config/default additions are compatibility-sensitive and extension production code should stay on Plugin SDK seams. (AGENTS.md:42, 010b61746379)
  • Docs define the expected gate: Current docs say the Microsoft Teams Graph-backed member-info action is gated by channels.msteams.actions.memberInfo, defaulting enabled when Graph credentials are available. Public docs: docs/channels/msteams.md. (docs/channels/msteams.md:490, 010b61746379)
  • Current main schema has no Teams memberInfo action gate: MSTeamsConfigSchema currently includes newer Teams cloud/serviceUrl fields and then proceeds from responsePrefix to welcome-card settings without actions.memberInfo. (src/config/zod-schema.providers-core.ts:1619, 010b61746379)
  • Current main always advertises member-info: describeMSTeamsMessageTool unconditionally includes member-info whenever Teams is enabled and configured. (extensions/msteams/src/channel.ts:397, 010b61746379)
  • Current main dispatch ignores the documented gate: The current member-info action path validates userId and calls getMemberInfoMSTeams without checking channels.msteams.actions.memberInfo. (extensions/msteams/src/channel.ts:1005, 010b61746379)
  • PR head gates discovery and dispatch: The PR head adds isMSTeamsMemberInfoActionEnabled, hides member-info from discovery when disabled, and returns a disabled-action error before runtime member lookup. (extensions/msteams/src/channel.ts:170, fecc292b0edf)

Likely related people:

  • sudie-codes: Authored the merged Teams Graph member-info action and adjacent group-management action work that this PR now gates. (role: feature introducer; confidence: high; commits: 4e67e7c02cd8, f71ee71787c7; files: extensions/msteams/src/channel.ts, extensions/msteams/src/graph-members.ts, extensions/msteams/src/channel.actions.test.ts)
  • heyitsaamir: Authored the merged Teams SDK rebase that added current cloud and serviceUrl config behavior this branch must preserve during conflict resolution. (role: recent adjacent Teams config contributor; confidence: medium; commits: 04c29825356f; files: src/config/zod-schema.providers-core.ts, src/config/types.msteams.ts, extensions/msteams/src/channel.test.ts)
  • Vincent Koc: Authored the docs update that advertises channels.msteams.actions.memberInfo and has config-adjacent release history in this area. (role: docs/config area contributor; confidence: medium; commits: 5c9408d3ca25; files: docs/channels/msteams.md, src/config/zod-schema.providers-core.ts)
  • BradGroux: Owns the open Microsoft tracker that currently lists this PR in the Teams queue, useful for routing even though the tracker is not the implementation path. (role: adjacent tracker owner; confidence: low; files: scripts/generate-microsoft-tracker.mjs)
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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 7, 2026
@IKANISA1
IKANISA1 force-pushed the codex/teams-member-info-action-gate branch from f5d4025 to fecc292 Compare May 7, 2026 08:22
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 7, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 14, 2026
@barnacle-openclaw

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@barnacle-openclaw barnacle-openclaw Bot added the stale Marked as stale due to inactivity label May 31, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 31, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 1, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant