Skip to content

[plugin sdk] Add host-mediated session attachments#75581

Closed
100yenadmin wants to merge 6 commits into
openclaw:mainfrom
electricsheephq:split/plugin-sdk-session-attachments
Closed

[plugin sdk] Add host-mediated session attachments#75581
100yenadmin wants to merge 6 commits into
openclaw:mainfrom
electricsheephq:split/plugin-sdk-session-attachments

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented May 1, 2026

Copy link
Copy Markdown
Contributor

Why this matters

OpenClaw plugins increasingly need to send real files back to the user in the same session lane: support artifacts, generated reports, approval docs, exports, screenshots, and workflow evidence.

Without a generic seam, plugin authors end up with two bad options:

  • own Telegram/Slack/Discord delivery logic themselves, including route lookup and transport quirks; or
  • push product-specific attachment routes into OpenClaw core.

This PR adds the missing middle layer: a bundled plugin can ask the host to validate local files and deliver them through the active direct-outbound session route, while OpenClaw keeps ownership of channel credentials, delivery routing, formatting quirks, and transport behavior.

What kinds of plugins this could support

This seam is intentionally generic. It can support many plugin families without adding plugin-specific delivery logic to core:

  • Support and incident plugins: send logs, screenshots, repro bundles, or diagnostics back into the live support conversation.
  • Approval and review plugins: attach generated PDFs, redlines, or diffs into the same operator thread that requested them.
  • CRM and case-management plugins: deliver quote files, customer evidence, or case exports to the active session route.
  • Field ops and inspection plugins: return photos, signed forms, or inspection reports to the same conversation lane.
  • Migration and import plugins: send rejected-record CSVs or validation reports back to a human operator.
  • Research and reporting plugins: attach exported summaries or evidence files instead of pasting large blobs into chat.

The important part: the plugin decides what artifact to send. OpenClaw decides whether the file is safe and where the active session route actually goes.

New SDK seam

This PR adds:

  • OpenClawPluginApi.sendSessionAttachment(...)
  • typed attachment params and result types in the SDK
  • host-side file validation, size/count limits, session-route lookup, and stale-registry protection
  • workspace-relative resolution against the session agent workspace
  • channel hints for caption formatting, Telegram delivery behavior, and Slack thread targeting

Example plugin usage:

const result = await api.sendSessionAttachment({
  sessionKey: "agent:main:main",
  files: [{ path: "./proof-report.txt" }],
  text: "attachment ready",
  captionFormat: "plain",
});

Runtime architecture

flowchart LR
  Plugin["Plugin callback, handler, or workflow"] --> SDK["sendSessionAttachment(...)"]
  SDK --> Validate["Host file validation and workspace resolution"]
  Validate --> Route["Active session route lookup"]
  Route --> Channel["Direct outbound channel adapter"]
  Channel --> User["Delivered attachment in the live session lane"]
Loading

The plugin never talks directly to Telegram, Slack, or another channel transport. It asks the host to deliver a validated file to the already-active session route.

Safety and boundaries

This stays intentionally narrow:

  • bundled-only: this seam depends on host-managed session and channel integrations
  • the host validates file count, size, path, and optional delivery hints before calling the outbound adapter
  • relative paths resolve against the session agent workspace instead of whatever host cwd happens to be active
  • delivery stays bound to the active session route; plugins do not get arbitrary channel send power
  • stale or unloaded plugin registries are rejected instead of dispatching through dead state
  • channel hints stay hints; plugins do not take raw provider or credential ownership

This is a host-mediated attachment seam, not a generic channel SDK.

What changed

  • Added OpenClawPluginApi.sendSessionAttachment plus SDK exports for attachment params and results.
  • Added host-side file validation, delivery-route lookup hardening, bundled-plugin enforcement, and stale-registry protection.
  • Resolved relative file paths against the session agent workspace so real plugin callbacks do not fall back to the default host workspace.
  • Added channel attachment hints from [plugin sdk] Add generic SDK seam followups #74483: caption-format precedence, Telegram silent/parse-mode/force-document hints, and Slack thread targeting.
  • Plumbed parseMode through outbound message formatting and the Telegram direct/gateway adapters.
  • Re-exported Telegram formatting helpers for plugin authors that need Telegram-safe captions.
  • Preserved the loader's closed-after-register guard for registration-only APIs, but kept sendSessionAttachment callable after register() so a real bundled plugin can capture it during registration and invoke it later from a live callback or handler.
  • Added focused contract and loader regression coverage for stale-registry protection, workspace-relative resolution, direct route dispatch, and post-registration late calls.

Relationship to adjacent seams

This does not try to solve scheduling, session actions, session projection, or run-context lifecycle. It is deliberately narrower: one host-mediated path for delivering plugin-owned files through the active session route.

Non-goals

  • Does not give plugins direct Telegram, Slack, or Discord delivery ownership.
  • Does not add arbitrary channel broadcast or free-form outbound routing.
  • Does not include scheduled turns, session actions, derived path facts, SessionEntry projection, finalize retry/run-context lifecycle, or advanced workflow composition fixtures.
  • Does not claim to close broader Control UI/native-page RFC scope; this only adds the generic attachment delivery seam.

Stack context

Real behavior proof

Behavior or issue addressed:
This fixes the narrow host-mediated attachment seam without broadening it into direct channel ownership. Before these follow-up fixes, a captured sendSessionAttachment closure could be closed accidentally by the loader guard, relative attachment paths could resolve against the wrong workspace, and Telegram media captions could be forced through the HTML path even when HTML was not explicitly requested. After this patch, the loader keeps sendSessionAttachment callable after register(), the host resolves relative paths against the session agent workspace, and the active direct-outbound route receives the validated file plus caption text.

Real environment tested:
Standalone runtime proof from /Users/lume/openclaw-review-worktrees/pr-75581-rebase using a live session store, an agent workspace rooted in a fresh temp state directory, and a direct outbound proof channel registered in the active plugin registry.

Exact steps or command run after this patch:

node --import tsx <<'NODE'
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import { updateSessionStore } from './src/config/sessions.js';
import { sendPluginSessionAttachment } from './src/plugins/host-hook-workflow.js';
import { setActivePluginRegistry, getActivePluginRegistry } from './src/plugins/runtime.js';
import { createTestRegistry } from './src/test-utils/channel-plugins.js';

const previousRegistry = getActivePluginRegistry();
const stateDir = await fs.mkdtemp(path.join(os.tmpdir(), 'openclaw-pr75581-proof-'));
const workspaceDir = path.join(stateDir, 'workspace');
const storePath = path.join(stateDir, 'sessions.json');
await fs.mkdir(workspaceDir, { recursive: true });
await fs.writeFile(path.join(workspaceDir, 'proof-report.txt'), 'proof attachment body\n', 'utf8');
await updateSessionStore(storePath, (store) => {
  store['agent:main:main'] = {
    sessionId: 'session-id',
    updatedAt: Date.now(),
    deliveryContext: { channel: 'proofchat', to: '12345', accountId: 'default' },
  };
  return undefined;
});
const deliveries = [];
setActivePluginRegistry(
  createTestRegistry([
    {
      pluginId: 'proofchat',
      source: 'proof',
      plugin: {
        id: 'proofchat',
        meta: {
          id: 'proofchat',
          label: 'Proof Chat',
          selectionLabel: 'Proof Chat',
          docsPath: '/channels/proofchat',
          blurb: 'proof direct channel',
        },
        capabilities: { chatTypes: ['direct'] },
        config: {
          listAccountIds: () => ['default'],
          resolveAccount: () => ({ accountId: 'default' }),
        },
        outbound: {
          deliveryMode: 'direct',
          sendText: async ({ to, text, accountId }) => {
            deliveries.push({ to, text, mediaUrl: null, accountId: accountId ?? null });
            return { channel: 'proofchat', messageId: 'proof-text-1' };
          },
          sendMedia: async ({ to, text, mediaUrl, accountId }) => {
            deliveries.push({ to, text, mediaUrl: mediaUrl ?? null, accountId: accountId ?? null });
            return { channel: 'proofchat', messageId: 'proof-media-1' };
          },
        },
      },
    },
  ]),
);

const result = await sendPluginSessionAttachment({
  origin: 'bundled',
  sessionKey: 'agent:main:main',
  files: [{ path: './proof-report.txt' }],
  text: 'attachment ready',
  config: {
    session: { store: storePath },
    agents: { list: [{ id: 'main', workspace: workspaceDir }] },
  },
});
console.log(JSON.stringify({ result, deliveries }, null, 2));
setActivePluginRegistry(previousRegistry);
NODE

Evidence after fix:

{
  "result": {
    "ok": true,
    "channel": "proofchat",
    "deliveredTo": "12345",
    "count": 1
  },
  "deliveries": [
    {
      "to": "12345",
      "text": "attachment ready",
      "mediaUrl": "/var/folders/l7/tyvn8qfs50v57w__75s3k0f00000gp/T/openclaw-pr75581-proof-pHeAVB/workspace/proof-report.txt",
      "accountId": "default"
    }
  ]
}

Observed result after fix:
The bundled-only attachment dispatch succeeds, the relative attachment path resolves against the session agent workspace instead of falling back to the default host workspace, and the active direct-outbound route receives the resolved file plus caption text. The loader regression is also covered on this head by pnpm test src/plugins/loader.test.ts, which proves sendSessionAttachment stays callable after register() while registration-only APIs still close.

What was not tested:
This proof did not exercise a full external Telegram/Slack/Discord live account or an end-to-end GUI flow. The runtime proof here is intentionally limited to real host validation, session-route lookup, workspace-relative path resolution, and direct outbound attachment dispatch inside a live OpenClaw runtime.

Validation

  • pnpm test src/plugins/loader.test.ts
  • pnpm test src/config/sessions/delivery-info.test.ts src/plugins/contracts/session-attachments.contract.test.ts extensions/telegram/api.test.ts extensions/telegram/src/outbound-adapter.test.ts extensions/telegram/src/channel.gateway.test.ts
  • pnpm plugin-sdk:api:check
  • pnpm lint:core
  • pnpm lint:extensions
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram size: L labels May 1, 2026
@clawsweeper

clawsweeper Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
Adds OpenClawPluginApi.sendSessionAttachment, host-side session attachment validation/routing, Telegram/Slack delivery hints, gateway send options, SDK/docs/changelog updates, and focused regression coverage.

Reproducibility: not applicable. for a current-main bug because this is an additive Plugin SDK feature. The PR regression is source-reproducible by following sendPluginSessionAttachment from route lookup into a sendMessage call that omits cfg.

Real behavior proof
Needs stronger real behavior proof before merge: The PR body includes terminal proof for the direct helper path, but not after-fix proof of a bundled plugin calling api.sendSessionAttachment through the public SDK/loader path; add redacted terminal output, logs, or a recording and update the PR body for re-review.

Next step before merge
Needs contributor real behavior proof and maintainer review after the narrow config handoff blocker is fixed; automation cannot supply proof from the contributor's setup.

Security
Needs attention: The diff can deliver validated local files under a different runtime config than the one used for validation and route lookup.

Review findings

  • [P2] Pass the live config into attachment delivery — src/plugins/host-hook-workflow.ts:278-292
Review details

Best possible solution:

Keep the bundled-only host-mediated seam, forward the selected live config through route lookup, validation, and outbound delivery, then add redacted public-SDK-path runtime proof before maintainer review.

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

Not applicable for a current-main bug because this is an additive Plugin SDK feature. The PR regression is source-reproducible by following sendPluginSessionAttachment from route lookup into a sendMessage call that omits cfg.

Is this the best way to solve the issue?

No, not merge-ready as written. The seam shape is plausible, but the outbound handoff should use the same live config snapshot and the proof should exercise a bundled plugin calling the public SDK method after registration.

Full review comments:

  • [P2] Pass the live config into attachment delivery — src/plugins/host-hook-workflow.ts:278-292
    sendPluginSessionAttachment resolves the session route and validates attachment paths with params.config, but then calls sendMessage without cfg. sendMessage falls back to runtime config when cfg is absent, so a reload or per-agent config change can validate one route and deliver with stale channel/account/media policy. Pass the same config into this call and cover that handoff.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.87

Security concerns:

  • [medium] Preserve live delivery policy config — src/plugins/host-hook-workflow.ts:278
    Because the attachment path validates files and resolves the session route with params.config but calls sendMessage without cfg, outbound channel, account, and media policy can be resolved from a stale runtime config. Passing the same config through keeps validation and delivery policy consistent.
    Confidence: 0.78

What I checked:

  • docs_list_ran: Ran the repository docs index first; docs/plugins/sdk-overview.md is the relevant public Plugin SDK surface for this API. (docs/plugins/sdk-overview.md:144, 5534c2e480c1)
  • current_main_missing_api: Current main has no sendSessionAttachment, PluginSessionAttachment, or sendPluginSessionAttachment matches, so this PR is not obsolete on main. (5534c2e480c1)
  • pr_adds_sdk_contract: The PR head adds the attachment params/result types, including session key, files, captions, thread id, max size, and channel hints. (src/plugins/host-hooks.ts:171, 38cb8e53aa0a)
  • registry_uses_live_config: The registry handler reads registryParams.runtime.config?.current?.() before delegating, so the intended design is to use the live config snapshot for attachment sends. (src/plugins/registry.ts:2565, 38cb8e53aa0a)
  • config_not_forwarded_to_send: sendPluginSessionAttachment resolves routes and validates files with params.config, but the downstream sendMessage call omits cfg: params.config. (src/plugins/host-hook-workflow.ts:278, 38cb8e53aa0a)
  • send_message_cfg_contract: sendMessage accepts cfg?: OpenClawConfig; when absent, resolveMessageConfig falls back to runtime config, which can differ from the config already selected by the attachment path. (src/infra/outbound/message.ts:315, 5534c2e480c1)

Likely related people:

  • 100yenadmin: Authored the merged generic plugin host-hook foundation and adjacent session-extension follow-up that this attachment seam builds on, and owns the current PR branch commits. (role: feature-history owner and current proposer; confidence: high; commits: 1adaa28dc86b, cb3853587576, 45d11008df16; files: src/plugins/host-hooks.ts, src/plugins/registry.ts, src/plugins/host-hook-workflow.ts)

Remaining risk / open question:

  • Attachment route lookup/file validation and outbound channel/account/media policy can diverge after config reloads because the live config is not forwarded to sendMessage.
  • The submitted real behavior proof does not show a bundled plugin calling the public api.sendSessionAttachment closure through the loader path after registration.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5534c2e480c1.

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Fixed in 69ce0ade322. captionFormat: "plain" for Telegram attachments is now delivered as escaped HTML with parseMode: "HTML", so plain captions like 1 < 2 & 3 > 2 do not hit Telegram HTML parsing unsafely. Test: src/plugins/contracts/session-attachments.contract.test.ts covers escaped plain Telegram captions. Validation: pnpm test src/plugins/contracts/session-attachments.contract.test.ts src/config/sessions/delivery-info.test.ts extensions/telegram/api.test.ts, pnpm plugin-sdk:api:check, pnpm lint:core, git diff --check, npm run check:no-conflict-markers. pnpm check:test-types is currently blocked by unrelated fresh-main errors in src/commands/onboard-non-interactive.ts.

@100yenadmin
100yenadmin marked this pull request as ready for review May 1, 2026 12:39
Copilot AI review requested due to automatic review settings May 1, 2026 12:39
@100yenadmin
100yenadmin force-pushed the split/plugin-sdk-session-attachments branch from 69ce0ad to 9ab5cc0 Compare May 1, 2026 12:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69ce0ade32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config/sessions/delivery-info.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Plugin SDK seam for host-mediated session attachments, allowing bundled plugins to request host validation and delivery of local files through the active session route, plus related outbound formatting/threading plumbing (notably Telegram parse-mode wiring) and delivery-route lookup hardening.

Changes:

  • Add OpenClawPluginApi.sendSessionAttachment with SDK-exported types and host-side implementation/validation.
  • Harden delivery-route lookup (extractDeliveryInfo) across per-agent session stores and freshest-entry selection.
  • Plumb parseMode/formatting through outbound messaging and Telegram adapters; re-export Telegram formatting helpers for plugin authors.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/plugins/types.ts Exposes new attachment params/result types and adds sendSessionAttachment to the plugin API type.
src/plugins/registry.ts Wires sendSessionAttachment into the registry with side-effects + stale-registry/loaded checks.
src/plugins/host-hooks.ts Defines the new attachment types (PluginSessionAttachmentParams, hints, result union).
src/plugins/host-hook-workflow.ts Implements host-side attachment validation, delivery-route resolution, and sendMessage dispatch.
src/plugins/contracts/session-attachments.contract.test.ts Adds contract tests for validation, hint precedence, Telegram escaping, and stale-registry protection.
src/plugins/captured-registration.ts Adds a stub implementation for captured registrations.
src/plugins/api-builder.ts Adds handler wiring + noop fallback for sendSessionAttachment.
src/plugin-sdk/plugin-test-api.ts Adds sendSessionAttachment stub to the test plugin API.
src/plugin-sdk/plugin-entry.ts Re-exports attachment types from the SDK entry surface.
src/plugin-sdk/core.ts Re-exports attachment types from the SDK core surface.
src/infra/outbound/message.ts Adds parseMode to sendMessage params and forwards it to outbound formatting (direct delivery).
src/infra/outbound/formatting.ts Extends outbound formatting options with parseMode.
src/config/sessions/delivery-info.ts Enhances delivery-context lookup across per-agent stores and prefers freshest entries; supports injected cfg.
src/config/sessions/delivery-info.test.ts Updates/extends tests for per-agent store lookup and numeric threadId behavior.
extensions/telegram/src/outbound-adapter.ts Threads formatting into direct Telegram outbound adapter and sets textMode based on parseMode.
extensions/telegram/src/format.ts Exports escapeTelegramHtml for reuse by plugin authors.
extensions/telegram/src/channel.ts Threads formatting into Telegram channel sends and maps parseMode to textMode.
extensions/telegram/api.ts Re-exports Telegram formatting helpers/types.
extensions/telegram/api.test.ts Adds coverage verifying Telegram helper re-exports behave as expected.
docs/.generated/plugin-sdk-api-baseline.sha256 Updates SDK API baseline hashes.
CHANGELOG.md Documents the new sendSessionAttachment feature.

Comment thread src/plugins/host-hooks.ts
Comment thread extensions/telegram/src/channel.ts Outdated
Comment thread extensions/telegram/src/outbound-adapter.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2bdf9477a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config/sessions/delivery-info.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06abbcd273

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config/sessions/delivery-info.ts Outdated
Comment thread src/plugins/registry.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Comment thread src/plugins/host-hooks.ts
Comment thread src/plugins/host-hook-workflow.ts Outdated
Comment thread src/config/sessions/delivery-info.ts Outdated
Comment thread extensions/telegram/src/channel.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea56729b49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/host-hook-workflow.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread src/plugins/host-hook-workflow.ts Outdated
Comment thread src/config/sessions/delivery-info.ts Outdated
Comment thread src/plugins/types.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9871e48e1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/host-hook-workflow.ts Outdated
Comment thread src/plugins/host-hook-workflow.ts Outdated
@100yenadmin
100yenadmin force-pushed the split/plugin-sdk-session-attachments branch from a623e9a to 2620cee Compare May 8, 2026 08:26
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed app: macos App: macos commands Command implementations labels May 8, 2026
@100yenadmin

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main 69c1487 (2026-05-08) — squash-rebase

Because this branch carried 19 incremental follow-up commits that each touched the same set of conflicting files (extensions/telegram/src/channel.ts, extensions/telegram/src/outbound-adapter.ts, etc.), the per-commit rebase produced cascading conflicts. I squashed the PR's tip into a single commit on top of upstream/main to make the rebase tractable.

Conflict resolutions:

  • apps/macos/Sources/OpenClawProtocol/GatewayModels.swift — dropped (deleted upstream; replaced by apps/shared/OpenClawKit/... which pnpm protocol:gen:swift keeps in sync).
  • extensions/telegram/src/outbound-base.ts — dropped (deleted upstream; the attachment-delivery surface is now baked into createTelegramOutboundAdapter).
  • extensions/telegram/src/outbound-adapter.ts — reset to upstream/main (upstream's createTelegramOutboundAdapter already integrates createAttachedChannelResultAdapter with sendMedia/sendPayload/sendPoll).
  • extensions/telegram/src/channel.ts — kept upstream's outbound: telegramChannelOutbound shape; dropped the PR's now-redundant buildTelegramSendOptions/sendTelegramOutbound helpers and inline outbound: { base, attachedResults } literal.
  • extensions/telegram/src/telegram-outbound.test.ts — kept upstream's telegramOutbound-based assertions; dropped the second test case that referenced the deleted telegramOutboundBaseAdapter/splitTelegramHtmlChunks.
  • extensions/matrix/src/matrix/monitor/handler.test.ts + handler.test-helpers.ts — kept upstream's liveCfg API and let currentConfig (when supplied) take precedence.
  • src/infra/outbound/message.ts — kept both upstream's mediaAccess plumbing and this PR's formatting plumbing.
  • docs/.generated/plugin-sdk-api-baseline.sha256 — regenerated; pnpm plugin-sdk:api:check OK. pnpm tsgo:core:test and pnpm tsgo:extensions:test both pass.

Force-pushed to split/plugin-sdk-session-attachments at 2620cee10e. Note: this is a squash, so the original commit history has been replaced with a single feat commit — rebase if you want to preserve incremental commits. The ~9 unresolved-current review threads (multiple in host-hook-workflow.ts, host-hooks.ts:166/183, outbound-adapter.ts:178, channel.ts:1134/1161, registry.ts:2403, infra/outbound/message.ts:306, delivery-info.ts) remain to be addressed.

@100yenadmin
100yenadmin force-pushed the split/plugin-sdk-session-attachments branch from a25bad5 to 14a6c63 Compare May 9, 2026 17:51
@100yenadmin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto current upstream/main, resolved the live review findings, kept the session-attachment seam narrow, and added the real behavior proof block to the PR body on head 14a6c63250ed5b2f378181eea6c4eb82427995ef.

@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 9, 2026
@100yenadmin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fresh head 527f396be9d86b5138ba21e7becd592b9c0be1d5: proof block is now in the required fielded format, the loader late-call type guard is fixed, and the follow-up loader regression test now uses the current plugin runtime types instead of stale literals.

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Fresh head c6a9b1b1604328b6f8dc95ba8fc4fdd533dba65a is an empty retrigger only.

Why I used a no-op commit instead of widening the diff:

  • the failing shard checks-node-agentic-plugin-sdk does reproduce as red on GitHub, but CI=1 GITHUB_ACTIONS=1 OPENCLAW_VITEST_MAX_WORKERS=2 OPENCLAW_TEST_PROJECTS_PARALLEL=2 NODE_OPTIONS=--max-old-space-size=6144 pnpm exec node scripts/test-projects.mjs test/vitest/vitest.plugin-sdk-light.config.ts test/vitest/vitest.plugin-sdk.config.ts passes locally on this branch
  • the failing qa-runner/facade files are unchanged vs upstream/main
  • GitHub denied workflow reruns without repo admin rights, so this was the narrowest honest way to force a fresh run

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Fresh head c7bb819a37895a1f3f42f3428e60f77bc81ce665 adds one clarifying test comment only.

Reason for this second follow-up: the earlier empty retrigger commit only woke the PR-body/label workflows; it did not create a new CI run for this fork PR. This one-line test comment is behavior-neutral, already inside a touched file, and exists solely to force a normal pull_request synchronize event so the full matrix reruns on the current head.

Eva and others added 6 commits May 10, 2026 13:35
Squashed rebase of PR #75581 onto upstream/main (rebase-2026-05-08).
Drops PR's outbound-base.ts and macOS GatewayModels.swift since
upstream already deleted those and integrated the attachment
delivery surface into createTelegramOutboundAdapter.

Original commits in PR include 19 follow-up fixes; squashed for
clean rebase. Refresh plugin-sdk-api-baseline.

Replaces part of #73384/#74483.
@100yenadmin

Copy link
Copy Markdown
Contributor Author

Superseded by #80229, which folds this session-attachment slice into the cleanup-first Plugin SDK consolidation branch tied to #80219.

@100yenadmin

Copy link
Copy Markdown
Contributor Author

Superseded by #80229, which now carries the combined proof and merge-ready consolidation branch.

@100yenadmin 100yenadmin reopened this May 10, 2026
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 10, 2026
steipete pushed a commit that referenced this pull request May 10, 2026
Squashed rebase of PR #75581 onto upstream/main (rebase-2026-05-08).
Drops PR's outbound-base.ts and macOS GatewayModels.swift since
upstream already deleted those and integrated the attachment
delivery surface into createTelegramOutboundAdapter.

Original commits in PR include 19 follow-up fixes; squashed for
clean rebase. Refresh plugin-sdk-api-baseline.

Replaces part of #73384/#74483.
@steipete

Copy link
Copy Markdown
Contributor

Thanks Eva. This session-attachment slice has been carried forward and merged via #80267, which preserved contributor credit and includes the consolidated Plugin SDK workflow surface.

Closing this PR as superseded by #80267.

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

Labels

app: web-ui App: web-ui channel: googlechat Channel integration: googlechat channel: matrix Channel integration: matrix channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime mantis: telegram-visible-proof Mantis should capture Telegram visible proof. proof: supplied External PR includes structured after-fix real behavior proof. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants