Skip to content

Add local Telegram channel SDK driver - #1

Merged
RomneyDa merged 5 commits into
mainfrom
codex/channel-sdk-foundation
Jun 16, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
codex/channel-sdk-foundation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jun 8, 2026 •

Copy link
Copy Markdown
Member

POSTE MERGE EDIT: This has more or less been reverted since should have used chat sdk

Summary

  • Add SDK-level local channel driver types, transcript semantics, and capability metadata.
  • Expose adapter: channel for deterministic Telegram local upstream runs without live credentials or VM orchestration.
  • Add crabline channel-matrix --json plus example Telegram local fixtures for future OpenClaw QA Lab smoke-ci evidence mapping.
  • Export a root package API for QA Lab integration: listLocalChannelDriverMatrix(), findLocalChannelDriver(), and runLocalChannelDriverSmoke().
  • Let runLocalChannelDriverSmoke({ channel: "telegram" }) resolve the concrete local driver inside Crabline, so OpenClaw does not hardcode Crabline driver IDs.
  • Keep the exported local-driver smoke path on the local channel provider, not the full native adapter registry, so OpenClaw can import it without pulling Slack/Discord/Matrix/iMessage runtime adapters.
  • Lazy-load optional native/loopback provider adapters so a Git-installed Crabline package can run local channel commands without installing optional native adapter peer packages.

Scope notes

  • Model responses stay out of scope except deterministic QA fixture replies needed by the channel driver (ack, echo, or none); no model calls are made.
  • Capability IDs are intended as stable mapping keys for OpenClaw QA Lab evidence, starting with telegram.dm.text, telegram.group.mention, telegram.group.topic, telegram.action.inline_button, telegram.media.metadata, and telegram.connection.reconnect.
  • The matrix uses concrete coverage status only (covered / planned / unsupported in the SDK type surface); it does not introduce extended, soak, manual, or advisory profiles.
  • PR Add Multipass mock channel foundation openclaw#91487 was used only for shape ideas: per-channel selection, metadata, and matrix visibility.

Testing

  • pnpm --ignore-workspace exec vitest run test/local-channel-driver-api.test.ts test/channel-provider.test.ts test/registry.test.ts
  • pnpm --ignore-workspace exec vitest run test/registry.test.ts test/channel-provider.test.ts test/local-channel-driver-api.test.ts test/cli.test.ts
  • pnpm --ignore-workspace typecheck
  • pnpm --ignore-workspace verify
  • Packed-install smoke: pack Crabline, install the tarball into a temp app, import and run runLocalChannelDriverSmoke({ channel: "telegram" }) from crabline.
  • Packed-install smoke: import listLocalChannelDriverMatrix from crabline, run crabline --json channel-matrix, and run crabline --json run local-roundtrip with adapter: channel.
  • pnpm dev channel-matrix --json
  • pnpm dev roundtrip telegram-local-dm --config fixtures/examples/crabline.example.yaml --json

@clawsweeper

clawsweeper Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 14, 2026, 9:20 AM ET / 13:20 UTC.

Summary
The PR adds a deterministic Telegram-local channel driver, channel transcript/capability types, adapter: channel config, channel-matrix CLI output, fixtures, docs, and tests.

Reproducibility: not applicable. This PR adds a new deterministic Telegram-local SDK driver and capability matrix rather than fixing a current-main bug. Current main lacks that feature, while the PR adds focused tests and has a passing verify check.

Review metrics: 2 noteworthy metrics.

  • PR surface: 16 files, +1006/-4. The change spans schema, registry, CLI, driver source, docs, fixtures, and tests rather than one isolated helper.
  • Public contract surface: 1 adapter, 1 driver ID, 6 Telegram capability IDs, 1 CLI command. These names are likely to become automation-facing contracts after merge.

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

  • [P2] Confirm whether adapter: channel, telegram-local-v1, transcript semantics, and the capability IDs are stable before merge.
  • Keep the linked OpenClaw QA Lab PRs aligned with whichever metadata source-of-truth decision maintainers choose.

Risk before merge

  • [P1] Merging this PR would make adapter: channel, telegram-local-v1, transcript fields, and capability IDs look stable to downstream QA tooling.
  • [P1] The linked OpenClaw QA Lab consumer PRs are still open, so maintainers need to decide whether this Crabline PR should be the durable metadata source of truth now.

Maintainer options:

  1. Approve the SDK Contract (recommended)
    Merge once maintainers explicitly accept the adapter name, driver ID, transcript semantics, and capability IDs as durable enough for downstream QA mapping.
  2. Mark Experimental Surfaces First
    Rename or document the new identifiers as experimental before merge if the contract should remain free to change.
  3. Wait for Consumer Boundary
    Pause if maintainers want the linked OpenClaw QA Lab PRs finalized before freezing the Crabline metadata shape.

Next step before merge

  • [P2] The remaining action is maintainer acceptance of a new SDK/config contract and linked QA Lab boundary, not a narrow automated repair.

Security
Cleared: The diff adds local TypeScript source, docs, fixtures, and tests without dependency, workflow, lockfile, script, secrets, download, or package-resolution changes.

Review details

Best possible solution:

Merge only after maintainers accept the new Crabline channel SDK/config contract as stable enough for the linked QA Lab stack.

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

Not applicable: this PR adds a new deterministic Telegram-local SDK driver and capability matrix rather than fixing a current-main bug. Current main lacks that feature, while the PR adds focused tests and has a passing verify check.

Is this the best way to solve the issue?

Unclear until maintainer review: the implementation is coherent and not already duplicated on main, but the best permanent solution depends on accepting this PR as the Crabline source of truth for the linked OpenClaw QA Lab channel-driver stack.

AGENTS.md: not found in the target repository.

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

Label changes

Label justifications:

  • P2: This is a normal-priority SDK/QA feature with bounded runtime blast radius but meaningful config and automation-contract impact.
  • merge-risk: 🚨 compatibility: Merging could freeze adapter, driver, transcript, and capability identifiers that downstream QA Lab tooling may consume.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. A deterministic local channel driver can unlock repeatable QA evidence mapping without live Telegram credentials or VM orchestration.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor after-fix proof gate does not apply; the PR body lists local verification commands and GitHub reports verify passing.
Evidence reviewed

What I checked:

  • Target AGENTS.md check: No AGENTS.md exists inside the target repo root; the only match found was outside the git root and was not applied as target policy. (ae55252b1e44)
  • Current main lacks the feature: Current main has Telegram only as an OpenClaw script-bridge channel and no adapter: channel, telegram-local-v1, or channel-matrix implementation. (README.md:102, ae55252b1e44)
  • New config contract: The PR adds channel to BUILTIN_ADAPTERS and defines Telegram-only channel provider config for telegram-local-v1. (src/config/schema.ts:7, 7cd70edde40c)
  • New provider implementation: The PR adds LocalChannelProviderAdapter, backed by the Telegram local channel driver and transcript storage for probe/send/roundtrip/watch behavior. (src/providers/builtin/channel.ts:21, 7cd70edde40c)
  • New CLI surface: The PR adds the channel-matrix command and renders deterministic local channel driver metadata in text or JSON. (src/cli/program.ts:57, 7cd70edde40c)
  • Focused tests: The PR adds tests for deterministic Telegram DM roundtrip behavior, group/topic/action metadata, and local capability matrix rows. (test/channel-provider.test.ts:70, 7cd70edde40c)

Likely related people:

  • Peter Steinberger: Git log and blame show the initial CLI runtime, manifest schema, provider registry/catalog, native provider additions, and Telegram bridge guidance came from Peter Steinberger commits. (role: introduced provider and CLI framework; confidence: high; commits: 1d9a587b2cc9, 141c704939fa, d6971d08fed6; files: src/cli/program.ts, src/config/schema.ts, src/providers/registry.ts)
  • RomneyDa: RomneyDa authored the recent repo-wide crabline rename on current main, touching README, CLI, config, providers, fixtures, and tests in the same area this PR extends. (role: recent adjacent contributor; confidence: medium; commits: ae55252b1e44; files: README.md, src/cli/program.ts, src/config/schema.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.

@clawsweeper clawsweeper Bot added 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 priority bug or improvement with limited blast radius. labels Jun 8, 2026
@clawsweeper clawsweeper Bot added feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 9, 2026
@RomneyDa
RomneyDa force-pushed the codex/channel-sdk-foundation branch from 228a6a8 to 631da8a Compare June 9, 2026 01:33
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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 Jun 12, 2026
@RomneyDa
RomneyDa force-pushed the codex/channel-sdk-foundation branch from 631da8a to 7cd70ed Compare June 13, 2026 08:21
@clawsweeper clawsweeper Bot added 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. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 13, 2026
@RomneyDa
RomneyDa force-pushed the codex/channel-sdk-foundation branch from 93d8a22 to 2a1dfab Compare June 15, 2026 22:21
@RomneyDa
RomneyDa merged commit 5e8031a into main Jun 16, 2026
1 check passed
@RomneyDa
RomneyDa deleted the codex/channel-sdk-foundation branch June 16, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant