Skip to content

feat(connector-slack): make ConnectorSlackPlugin's static bot token optional - #36681

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-oxj1ql
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-oxj1ql

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #35791

repo:objectstack#3 · os-support-ai · session_01WGufzh5qSa4qh6mCPSykM6

Claim: seat 3 comment 7099367389 on the card, naming branch claude/project-thread-oxj1ql.

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:只用各组织自己 Slack 令牌发私信的部署,装 Slack 插件时不必再填一个占位的机器人令牌;不填时启动日志说一句「流程里的 Slack 连接器没注册」,填了则一切照旧。
  • 为什么做:Slack 私信渠道(替各组织用自己的令牌给成员发 Slack 私信)上线后留下的收尾,插件的令牌只给流程连接器用,私信用不到。
  • 出错会怎样:没填令牌的部署里,流程若引用 Slack 连接器,会和没装插件时一样执行失败;填了令牌的部署行为不变,可直接撤回本改动。
  • 要你做什么:无。

What changes

  • ConnectorSlackPluginOptions is now Omit<SlackConnectorOptions, 'token'> plus token?: string, and the constructor's options argument is optional.
  • start(): without a token (absent or empty string) the plugin logs one info line (no static bot token — flow Slack connector not registered; the 'slack' client service serves caller-held tokens only) and returns before touching the automation engine. With a token it registers the slack flow connector exactly as before.
  • init() is unchanged: the slack client service (createSlackClientService, already token-free since feat(messaging): Slack DM delivery — slack channel, per-person link store, approval requests by DM (Part of #34730) #35789) is registered in both compositions.
  • SlackConnectorOptions.token and createSlackConnector are unchanged: the connector itself still requires a token.

Tests

packages/connectors/connector-slack/src/connector-slack-plugin.test.ts, new block "composed without a static bot token":

  • Kernel composition with { fetchImpl } only: the automation engine is up (connector_action registered, positive control) and has no slack connector; the slack client service sends with the caller's token.
  • Kernel composition with new ConnectorSlackPlugin(): boots, no connector, client service present.
  • Harness context, token omitted and token '': exactly one info line, the registry's registerConnector never called, destroy() a no-op.
  • Same harness with a token: the connector is registered (control for the skip).

The existing token-ful tests (end-to-end flow post, client service, shutdown unregister) are unchanged and green, which pins the "with a token, unchanged" half.

Acceptance notes

  • Clause-② measured on the built declaration: packages/connectors/connector-slack/dist/index.d.ts exports type ConnectorSlackPluginOptions from the package entry (exports["."], files: ["dist", …]), now spelled interface ConnectorSlackPluginOptions extends Omit<SlackConnectorOptions, 'token'> { token?: string; } and constructor(options?: ConnectorSlackPluginOptions). Published surface, widened only: every value accepted before is still accepted. Hence yes (widening); it owes the seat's TIER_DEFAULT review of the declaration.
  • Metadata-protocol: none: a plugin constructor option, not stored metadata. Kind none ⇒ patch.
  • An empty-string token is read as absent, so a deployment wiring an unset environment value through as "" gets the skip and its log line rather than a connector that fails every call with not_authed.
  • No other in-repo composition passes a tokenless option today (runtime and service-messaging composition tests all pass a token), so no consumer changes.

Verification

Two-minute check: pnpm --filter @objectstack/connector-slack exec vitest run src/connector-slack-plugin.test.ts, expect 7 passed.

Local runs (head 2884796)
  • pnpm --filter '@objectstack/connector-slack^...' build under the verify lock: VERDICT command-exit 0.
  • pnpm --filter @objectstack/connector-slack test && … typecheck && … build: Test Files 3 passed (3), Tests 16 passed (16), VERDICT command-exit 0. tsc --listFiles includes the 3 test files.
  • Ablation (source-imported test, no dist leg): node scripts/ablation-replace.mjs replaced if (!token) { with if (false as boolean) { (anchor 1 → 0, blob 67ae6dad → 0d7e87e8); src/connector-slack-plugin.test.ts went Tests 4 failed | 3 passed (7), the four tokenless cases red; restored, blob == HEAD 67ae6dad, git diff HEAD empty.
  • Derived gate families (dispatch-gates.mjs --commands, 65): 64 run with exit 0, 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET, 39 untouched packages without dist/; CI builds and runs it). check-plugin-teardown-shape --self-test first exited 3 on the shallow clone, re-run after fetching its pinned fixture: 48 cases pass. dispatch-gates.mjs --ran: "65 derived famil(ies) accounted for — 64 run, 1 NOT-MEASURED". Change set 132 lines, under the 3000-line human-merge threshold.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (CI)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…ptional

Without a token the plugin registers only the 'slack' client service for
caller-held tokens and skips the flow connector, logging that once at boot.
With a token, behaviour is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzh5qSa4qh6mCPSykM6
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 4bbe4b24799fc6d32ebbab42a27ef8463c758a0d — the merge of head 288479620743cedc42cd482b65ba2834a52f3f05 into base 6a731859def47e2c8cefcab4d635a1c45c60c2c1, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4bbe4b24799fc6d32ebbab42a27ef8463c758a0d && git checkout 4bbe4b24799fc6d32ebbab42a27ef8463c758a0d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a731859def47e2c8cefcab4d635a1c45c60c2c1 288479620743cedc42cd482b65ba2834a52f3f05 && git checkout -B drift-repro 6a731859def47e2c8cefcab4d635a1c45c60c2c1 && git merge --no-ff 288479620743cedc42cd482b65ba2834a52f3f05

node scripts/docs-audit/affected-docs.mjs --json 6a731859def47e2c8cefcab4d635a1c45c60c2c1

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 288479620743cedc42cd482b65ba2834a52f3f05
Local-runs: none
Security-touching: no
Rule-change-verified: yes

① Derived judgments

  • The face is the Clause-②: yes (widening) declaration alone (no packages/spec/src/**, no governed path in the 3-file diff). The widening: the exported ConnectorSlackPluginOptions becomes Omit<SlackConnectorOptions, 'token'> & { token?: string }, and the constructor's options argument defaults to {}. Everything that compiled before still compiles (a required field made optional, a required parameter made optional), so the accept set only grows.
  • SlackConnectorOptions.token and createSlackConnector stay required: the flow connector still cannot be built without a token, and start() passes { ...shared, token } only after the !token early return, so no path builds a connector with an undefined token.

② Semver level

  • Additive and backward compatible on the published entry: patch per the repo's changeset convention for a fix-shaped widening; no removal, no narrowing.

③ Boundary flags

  • Real pull for the widening: the card's deployments deliver Slack DMs with each organization's own token (sys_channel_account), and the slack client service registered in init() already serves caller-held tokens; the placeholder token was the only reason to pass one. No speculative surface added.
  • No SQL, permission, credential storage or token handling changes: the token is not read, stored or logged anywhere new; the boot line names no token value.

④ Design judgment

  • not owed on the declaration face.

Implemented-by: claude/project-thread-oxj1ql
Reviewed-by: session_01WGufzi4PechTRCTBrfxV8W

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

席位核对 — ACCEPT · repo:objectstack#3 · head 2884796 · 2026-11-23T12:28Z

  • Shape: l1-face.mjs --pr 36681 at 288479620743cedc42cd482b65ba2834a52f3f05: draft, base main, first line Fixes #35791 (whole card), changeset for @objectstack/connector-slack, Clause-②: yes (widening) · Metadata-protocol: none (matches the claim 7099367389), no other card bound. The face's one flag is the superseded PR-body guards run 137654089414 (failure 11:15Z, before the claim); the same check's newest run 137655885572 is success.
  • Premise measured: the plugin always built the flow connector from options.token in start(); seat read the diff: no token (absent or '') ⇒ one info line and an early return, init() still registers the slack client service; with a token the connector is built exactly as before.
  • Gates: every check green at this head (38 success, 18 expected skip); Lint & Repo Gates and TypeScript Type Check success. Dev ablation turned the 4 tokenless cases red and restored.
  • Contract review (TIER_DEFAULT, declaration face): PASS, comment 7101119944.
  • Changeset sentences read against the diff: all true (optional token, empty string reads as absent, connector unchanged with a token, SlackConnectorOptions.token and createSlackConnector unchanged).
  • Accepted deviation: PR attribution links the card thread.
  • Landing: NOT governed, 132 changed lines; Tier S, ready + auto-merge by the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W

Landing · 2026-11-23T12:29Z · ACCEPT 7101143050 + contract review PASS 7101119944 at head 2884796

reading value
check-governed-merges.mjs --pr 36681 NOT governed · +127/-5
landing-k.mjs --pr 36681 K = 7 < 15 · ok

State: ready + auto-merge (Tier S). On MERGED, #35791 closes by Fixes; the seat removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 12:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 85dde2d Nov 23, 2026
57 of 58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-oxj1ql branch November 23, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants