Skip to content

fix(messaging): the approval Slack DM links the Console page under its mount - #36680

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-5p7j0q
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-5p7j0q

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #36301

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

The card's claim naming this branch is comment 7099292948 on #36301.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 审批人在 Slack 私信里点「审批请求」的链接,修前打开的是「找不到」页面,修后直接进入控制台里那条审批。
  • 属于「审批收尾」专题:邮件里的同一个链接上一轮已修好,这次补上 Slack 私信这一路。
  • 出错的话只影响私信里那一个链接的地址;审批本身、站内收件箱和邮件都不受影响,撤回这次改动即恢复原样。
  • 无。

What changes

packages/services/service-messaging only.

  • slack-channel.ts: a relative actionUrl is a Console route, so the DM link is now made absolute under origin + Console mount instead of origin alone. A module-internal consoleLinkBase(origin, composer) reads the mount from the auth service's Console page composer (getConsoleUrl, i.e. AuthConfig.uiBasePath), takes only the composer's PATH, strips any base path it shares with the origin (so a sub-path deployment is not prefixed twice — the same rule as plugin-approvals consolePageLink), and falls back to no mount when there is no composer, it answers nothing, throws, or answers a non-URL. No origin ⇒ no link, as before. The composer rides on a module-internal SlackChannelWiring taken by a module-internal mountSlackChannel; the published createSlackChannel delegates to it with the public options, which are unchanged, as are slackDmText / absoluteLink. An absolute actionUrl is sent as it is.
  • messaging-service-plugin.ts: mounts the channel through mountSlackChannel with getConsoleUrl read from the auth service per delivery (the same lazy reader plugin-approvals and plugin-audit use).
  • Package entry unchanged: index.ts is byte-identical to origin/main, SlackChannelOptions is byte-identical, and the built dist/index.d.ts / index.d.cts carry zero hits for consoleLinkBase, getConsoleUrl, ConsolePageComposer, mountSlackChannel, SlackChannelWiring. Hence Clause-②: no (L1 M1, comment 7101086524).
  • Changeset: @objectstack/service-messaging patch.

No new package edge: service-messaging does not import plugin-approvals (the mount rule is restated locally, with a pointer to consolePageLink), and plugin-approvals is untouched — its producer keeps actionUrl relative (/system/approvals?request=ID), which the in-app inbox needs.

Tests

  • slack-channel.test.ts — new block "the deep link under the Console mount": the posted approval DM text carries /_console/; custom uiBasePath and /; sub-path origin not prefixed twice; the composer's origin is ignored; no / empty / throwing / non-URL composer ⇒ no mount; no origin ⇒ no base.
  • slack-channel-composition.test.ts — new block through MessagingServicePlugin itself: with an auth service exposing getConsoleUrl, the mounted channel posts the link under /_console; with one that has none, the link is unchanged (control).
  • Ablation (committed fix, on-disk mutation via scripts/ablation-replace.mjs, restored to HEAD blob each time):
    • slack-channel.ts send path back to the bare origin ⇒ 2 failed / 19 passed (the unit send pin and the composition pin).
    • plugin wiring without getConsoleUrl ⇒ 1 failed / 20 passed (the composition pin); re-run after the rework on mountSlackChannel, same 1 failed / 20 passed, restored to the HEAD blob.
Local runs (head 65fe2ea)
  • pnpm --filter @objectstack/service-messaging build then typecheck ⇒ exit 0; test ⇒ Test Files 80 passed (80), Tests 1090 passed (1090) (on fc521e1; 65fe2ea changes three docblocks only, slack tests re-run there: 21 passed).
  • Derived gate families on 65fe2ea (node scripts/pm/dispatch-gates.mjs --commands): 73 derived, 73 run, all exit 0; --ran: "73 derived famil(ies) accounted for — 73 run, 0 NOT-MEASURED".
  • First round (edff20f): same package suite and 73/73 gates green; check-plugin-teardown-shape --self-test needed its fixture commit fetched on the shallow clone (exit 3 before, 0 after).

Acceptance notes

Verification

Live, on a real pnpm dev -- --fresh showcase boot (OS_AUTH_URL=http://localhost:PORT) with a Slack Web API sink preloaded (a --import module that answers https://slack.com/api/* locally and records each chat.postMessage payload): admin installs Slack (PUT /api/v1/messaging/slack/account), proposes and confirms their own link, then retitles a showcase_announcement, which starts showcase_dynamic_approval and sends the approval DM to the admin (org owner).

Captured DM text, before / after
  • Before (origin/main source of service-messaging, rebuilt): the title "Approval requested" linked to http://localhost:42375/system/approvals?request=areq_22f4a2e3-… — on that boot GET /system/approvals?request=x answers 404 ENDPOINT_NOT_FOUND.
  • After (this branch): the title "Approval requested" linked to http://localhost:42051/_console/system/approvals?request=areq_3363946e-… — GET /_console/system/approvals?request=x is the Console mount (it answered 503 "The ObjectStack Console is not built…" only because this container has no Console dist; with a built Console it serves the SPA route).

Two-minute check: pnpm --filter @objectstack/service-messaging exec vitest run src/slack-channel.test.ts — expect the "deep link under the Console mount" block green, the first case asserting https://os.example.com/_console/system/approvals?request=r1.

Read first: packages/services/service-messaging/src/slack-channel.ts (consoleLinkBase and the send line), then messaging-service-plugin.ts (the getConsoleUrl reader).


Generated by Claude Code

…s mount

The Slack channel made a relative actionUrl absolute as origin + path, with
no Console mount, so the approval DM's link to /system/approvals opened a
"not found" page on a default deployment (Console under /_console). The
channel now reads the mount from the auth service's Console page composer
(getConsoleUrl, AuthConfig.uiBasePath) per delivery, takes only its path
less any base path shared with the origin, and makes the link absolute
under origin + mount; the messaging plugin wires the composer.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzjF6c6pWoGHX3bWhw9
@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

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-messaging, touching 8 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/webhooks.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via MessagingServicePlugin (symbol, a top-level class))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v14.mdx (via MessagingServicePlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via MessagingServicePlugin (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 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 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 79b2999ac79c1772563e7333eb56bb734595c0b3 — the merge of head 65fe2ea87738b366fef3d78b4f4e2df2ee8315fa into base 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba, 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 79b2999ac79c1772563e7333eb56bb734595c0b3 && git checkout 79b2999ac79c1772563e7333eb56bb734595c0b3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba 65fe2ea87738b366fef3d78b4f4e2df2ee8315fa && git checkout -B drift-repro 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba && git merge --no-ff 65fe2ea87738b366fef3d78b4f4e2df2ee8315fa

node scripts/docs-audit/affected-docs.mjs --json 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 115d38788e2d5094ff0cb14b6f8be8f5ef3f1eba → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 — REWORK · repo:objectstack#3 · head edff20f · 2026-11-23T12:26Z

L1 at head edff20ff04 (l1-face.mjs --pr 36680: shape, first line Fixes #36301, changeset, floor checks ok; every check green, the old PR-body guards failure 137652935324 superseded by success 137654781233).

M1 — Clause-②: no does not match the diff. The package entry (packages/services/service-messaging/src/index.ts) now exports consoleLinkBase and the type ConsolePageComposer, and the exported SlackChannelOptions gains getConsoleUrl?. Each widens the published surface; the changeset says so itself ("createSlackChannel takes a new optional getConsoleUrl option, and the package exports consoleLinkBase … and the ConsolePageComposer type"). Fix:

  1. Drop the consoleLinkBase value export from index.ts: nothing outside the package reads it today (approvals/messaging: the approval Slack DM and the approval email build their deep link from different origins — share one source so a host that sets only publicBaseUrl still gets an absolute DM link #35844 is out of this PR and can export it when it needs it). Keep the function module-internal or module-exported only.
  2. getConsoleUrl? on SlackChannelOptions is the channel's real wiring point for a host that builds the channel itself, so it may stay, but then the declaration is Clause-②: yes in the PR body and the changeset (the ConsolePageComposer type is reachable through that option either way). If you can wire the mount without a new option on the exported type, do that instead and keep no; say which in the body.
  3. Rewrite the changeset's last paragraph to match.

A yes owes the seat's TIER_DEFAULT review of the declaration; the seat runs it on your next green head.

Checked and fine (no change asked): the mount rule (composer path less a shared base path, origin stays the channel's), the fallback to the old link when no auth service or no composer, the plugin wiring read per send, and the two test files' pins.

…ole composer internally

The package entry no longer exports consoleLinkBase or ConsolePageComposer,
and the published SlackChannelOptions is as it was. MessagingServicePlugin
mounts the channel through the module-internal mountSlackChannel, whose
wiring carries the auth service composer; createSlackChannel delegates to
it with the public options.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzjF6c6pWoGHX3bWhw9
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 — ACCEPT · repo:objectstack#3 · head 65fe2ea · 2026-11-23T13:02Z

  • Delta over REWORK 7101086524 (edff20ff..65fe2ea8, 5 files, +37/-20): M1 closed by its option "wire the mount without a new option on the exported type". src/index.ts at this head exports createSlackChannel, slackDmText, absoluteLink, deploymentOrigin and the type SlackChannelOptions only, so consoleLinkBase and ConsolePageComposer are off the entry. getConsoleUrl moved from the exported SlackChannelOptions to the module-internal SlackChannelWiring extends SlackChannelOptions, taken by mountSlackChannel, which MessagingServicePlugin now calls; createSlackChannel(opts) delegates to it unchanged. Clause-②: no now holds; the changeset's last paragraph says "No export changes" and that a host building the channel itself keeps the old link, which matches the diff.
  • Shape: Fixes #36301, changeset for @objectstack/service-messaging, Clause-②: no · Metadata-protocol: none (l1-face.mjs --pr 36680 CLEAN).
  • Gates: 39 success · 18 expected skip · 0 failed · 0 pending at 65fe2ea; mergeable_state clean.
  • Carried from the REWORK, unchanged and fine: the mount rule (composer path less a shared base path, origin stays the channel's), the fallback to the old link with no auth service or no composer, the composer read per send, and the two test files' pins.
  • Out of scope (no card from this PR): approvals/messaging: the approval Slack DM and the approval email build their deep link from different origins — share one source so a host that sets only publicBaseUrl still gets an absolute DM link #35844 (p3, the other relative-link senders) stays on its own card under the maintainer's p1/p2 scope for this seat.
  • Landing: check-governed-merges.mjs --pr 36680: NOT governed, +210/-12. landing-k.mjs: K = 4. 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-23T13:02Z · ACCEPT 7101980950 at head 65fe2ea

reading value
check-governed-merges.mjs --pr 36680 NOT governed · +210/-12
landing-k.mjs --pr 36680 K = 4 < 15 · ok
checks at 65fe2ea 39 success, 0 failed, 0 pending

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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 13:03
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 0fc430a Nov 23, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-5p7j0q branch November 23, 2026 13:34
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