Skip to content

feat: Slack integration — OAuth install, alert delivery, and MCP-backed Slack agent - #246

Merged
JeremyFunk merged 66 commits into
mainfrom
feat/slack-agent
Jul 28, 2026
Merged

JeremyFunk merged 66 commits into
mainfrom
feat/slack-agent

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Full Slack ↔ Maple integration across three areas, built on the eve-based Slack agent introduced earlier on this branch:

Backend (packages/db, packages/domain, apps/api)

  • New slack_workspaces table: team_id → orgId binding with AES-256-GCM-encrypted bot token and an auto-minted org-scoped mcp-kind API key (secret stored encrypted so it can be handed to the bot). Partial unique index enforces one active workspace per org; installs transactionally revoke/replace prior same-org workspaces, and a guarded upsert closes the concurrent cross-org install race.
  • Dashboard-initiated OAuth v2 install: POST /v2/integrations/slack/install (admin) → single-use, TTL-bound state → GET /oauth/slack/callback exchanges the code, mints the key, and redirects back to /integrations?integration=slack.
  • GET/DELETE /v2/integrations/slack (status/uninstall — uninstall revokes both the row and the minted API key) and GET /v2/integrations/slack/channels (conversations.list proxy for the channel picker).
  • Internal bot resolve endpoint GET /internal/slack/workspaces/:teamId guarded by the constant-time maple_svc_ bearer; returns {orgId, teamId, teamName, botToken, mapleApiKey}.
  • New slack-bot alert destination type: posts Block Kit via chat.postMessage using the installed workspace token + configured channel; works with the existing POST /v2/alerts/destinations/:id/test.

Slack agent (apps/slack-agent)

  • Multi-workspace: custom webhookVerifier owns Slack v0 signature verification and extracts team_id; per-team bot token resolved through a cached credentials client against the internal endpoint (SLACK_BOT_TOKEN remains a single-workspace dev fallback).
  • Read path: eve MCP client connection to Maple's /mcp with a per-session auth resolver that selects the installing org's API key from the session's team_id — the bot gets the same tool set as the in-dashboard chat agent (listServices, searchTraces, findErrors, diagnoseService, …).
  • Maple-domain instructions; README documents the manifest scopes, OAuth redirect, and the build-time MAPLE_API_BASE_URL baking footgun.

Web (apps/web)

  • Slack card on the integrations page: Add to Slack → OAuth → success/error toast, workspace status, admin-gated disconnect.
  • slack-bot destination in notification settings with searchable channel picker (public/private, invite-the-bot hint), only offered when the integration is installed.

Security review

An adversarial review of the OAuth flow, internal endpoint, crypto, and tenant isolation found no critical issues; its one real finding (ambiguous multi-workspace rows per org) is fixed as described above. Known accepted limitations, documented in the bot README: bot-side positive credential cache means uninstall takes up to ~5 min to fully propagate (MCP access dies immediately since the key is revoked), and concurrent events from different workspaces can make an outbound reply resolve the wrong team's token — which fails closed (Slack rejects the post).

Deployment notes

  • New api env: SLACK_CLIENT_ID / SLACK_CLIENT_SECRET (wired in alchemy.run.ts).
  • Railway bot env: MAPLE_API_BASE_URL (required at build time), MAPLE_INTERNAL_SERVICE_TOKEN.
  • Slack app manifest: add redirect URL https://<api-host>/oauth/slack/callback, broaden bot scopes (see apps/slack-agent/README.md), enable public distribution.
  • Migration 0017_fair_mandarin (slack_workspaces).

Testing

  • Full repo typecheck green (30/30 turbo tasks).
  • apps/api suite: 965+ passing incl. 12 new SlackIntegrationService PGlite tests (state handling, install/replace/revoke, resolve, dispatch token) and 16 AlertDeliveryDispatch tests incl. slack-bot arms.
  • apps/web: destination-builder unit tests for slack-bot create/update params; suite green apart from the two known pre-existing localStorage jsdom failures.
  • Bot: eve build + typecheck green; signature-verification/team-parsing/token-bridging verified by a 14-check standalone harness.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

JeremyFunk and others added 4 commits July 21, 2026 13:23
Adds apps/slack-agent, a standalone eve-framework Slack agent that
deploys itself to Railway (Docker) rather than Cloudflare Workers:

- Workers AI (REST) as the model backend, self-managed Slack app
  (bot token + signing secret) instead of a Connect integration
- @workflow/world-postgres for durable runs; EVE_WORKFLOW_WORLD is
  baked in at build time via the Dockerfile
- excluded from the bun workspace ("!apps/slack-agent") so its own
  bun.lock and eve toolchain resolve independently

Also adds scripts/ingest-dummy.ts for pushing dummy OTLP traces/logs
at the local ingest gateway, drops turbo concurrency to 15, and
gitignores the .eve model-catalog cache.
The agent was posting raw tool-call JSON into Slack:

  {"type": "function", "name": "ask_question", "parameters": {…}}

Not a formatting bug — a leaked tool call. @cf/meta/llama-3.3-70b-instruct-fp8-fast
only parses tool calls on non-streaming requests; eve's harness always streams, and
in streaming mode Workers AI returns that model's raw tool-call JSON as ordinary
`response` text deltas, which eve has no reason to treat as anything but assistant
text. (Even non-streaming it stringifies non-string args: "allowFreeform": "true".)

workers-ai-provider has a salvage path for leaked tool calls, but it's gated on a
forced tool choice — eve uses auto, so it never engages.

Switch to @cf/zai-org/glm-5.2, which streams OpenAI-shaped incremental
delta.tool_calls (name + id first, argument fragments keyed by index after) ending
in finish_reason: "tool_calls", and emits chain-of-thought on reasoning_content so
it maps to reasoning parts instead of message text. Bump the declared context
window to its 256K.

Verified through a live eve session: modelId workersai/@cf/zai-org/glm-5.2,
actions.requested → action.result, correct Tokyo time in prose.

Also documents the streaming-tool-call constraint, a curl to check any replacement
model's SSE shape, and the price trade-off vs gpt-oss-120b (also verified good, and
~5x cheaper on output if spend beats capability).

Includes the pending PORT 3000 -> 8080 alignment with the documented Railway setup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pullfrog

pullfrog Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Your Pullfrog Router balance is exhausted.

You have a card on file but auto-reload is disabled, so runs paused once your balance went past the overdraft buffer.

Top up balance → · Enable auto-reload →

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Opus | 𝕏

@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Ingest Rust Test + Benchmark Results

Commit: aec5c5661e65561067a03b3bb2c00dbda336940c

Load Benchmark — tinybird mode, median of 3 run(s) vs main

Metric main (median) PR (median) Delta
Requests/sec 8947.94 7209.52 -19.4% worse
Rows/sec 89479.43 72095.24 -19.4% worse
p50 latency 6.88 ms 8.40 ms +22.2% worse
p95 latency 13.46 ms 16.95 ms +25.9% worse
p99 latency 16.68 ms 23.58 ms +41.3% worse
Export catch-up 0.026 s 0.026 s -2.9% better
Max RSS 15.43 MiB 14.72 MiB -4.6% better
Failures 0 0 same

Same code path on both sides (same LOAD_TEST_INGEST_MODE), so the delta column is meaningful. Numbers come from ubuntu-latest, which is noisy — treat single-digit-percent deltas as noise.

PR load benchmark JSON (per-iteration)
[
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 16,
    "duration_seconds": 0.319051388,
    "export_catchup_seconds": 0.025543014,
    "request_rps": 6268.582664808843,
    "row_rps": 62685.82664808843,
    "p50_ms": 9.478,
    "p95_ms": 18.346,
    "p99_ms": 24.032,
    "max_rss_mb": 14.72265625,
    "max_cpu_percent": 33.3,
    "avg_cpu_percent": 33.3
  },
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 14,
    "duration_seconds": 0.277410812,
    "export_catchup_seconds": 0.025682633,
    "request_rps": 7209.524335338451,
    "row_rps": 72095.2433533845,
    "p50_ms": 8.4,
    "p95_ms": 16.954,
    "p99_ms": 23.579,
    "max_rss_mb": 14.6953125,
    "max_cpu_percent": 25.0,
    "avg_cpu_percent": 25.0
  },
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 14,
    "duration_seconds": 0.25751913,
    "export_catchup_seconds": 0.025710336,
    "request_rps": 7766.413314614724,
    "row_rps": 77664.13314614724,
    "p50_ms": 7.901,
    "p95_ms": 15.226,
    "p99_ms": 17.426,
    "max_rss_mb": 17.16015625,
    "max_cpu_percent": 33.3,
    "avg_cpu_percent": 33.3
  }
]
main load benchmark JSON (per-iteration)
[
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 12,
    "duration_seconds": 0.223771137,
    "export_catchup_seconds": 0.026449117,
    "request_rps": 8937.70316767886,
    "row_rps": 89377.0316767886,
    "p50_ms": 6.969,
    "p95_ms": 13.594,
    "p99_ms": 18.597,
    "max_rss_mb": 16.48046875,
    "max_cpu_percent": 20.0,
    "avg_cpu_percent": 20.0
  },
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 12,
    "duration_seconds": 0.223515064,
    "export_catchup_seconds": 0.026566769,
    "request_rps": 8947.94276595156,
    "row_rps": 89479.4276595156,
    "p50_ms": 6.875,
    "p95_ms": 13.464,
    "p99_ms": 15.603,
    "max_rss_mb": 14.6484375,
    "max_cpu_percent": 16.6,
    "avg_cpu_percent": 16.6
  },
  {
    "ingest_mode": "tinybird",
    "requests": 2000,
    "successes": 2000,
    "failures": 0,
    "rows_sent": 20000,
    "rows_exported": 20000,
    "imports": 12,
    "duration_seconds": 0.223079903,
    "export_catchup_seconds": 0.026074611,
    "request_rps": 8965.397479126572,
    "row_rps": 89653.97479126572,
    "p50_ms": 6.689,
    "p95_ms": 13.246,
    "p99_ms": 16.682,
    "max_rss_mb": 15.4296875,
    "max_cpu_percent": 0.0,
    "avg_cpu_percent": 0.0
  }
]

WAL-acked microbench (cargo bench --bench ingest_bench)

   Compiling maple-ingest v0.1.0 (/home/runner/_work/maple/maple/apps/ingest)
    Finished `bench` profile [optimized] target(s) in 24.83s
     Running benches/ingest_bench.rs (target/release/deps/ingest_bench-f6ec3881b8bd23cb)
Gnuplot not found, using plotters backend
test ingest_accept/logs_10_rows_wal_ack ... bench:      149765 ns/iter (+/- 12518)
test ingest_accept/traces_10_spans_wal_ack ... bench:      151349 ns/iter (+/- 30285)

cargo test

test usage_metrics::tests::each_interval_exports_only_its_own_increment ... ok
test usage_metrics::tests::records_bytes_and_items_per_org_and_signal ... ok
test telemetry::tests::wal_truncates_after_full_drain_allowing_further_appends ... ok
test usage_metrics::tests::cardinality_view_admits_more_orgs_than_the_sdk_default ... ok
test telemetry::tests::pipeline_exports_ready_org_to_clickhouse_without_tinybird_calls ... ok
test telemetry::tests::slow_clickhouse_lane_does_not_block_cosharded_tinybird_org ... ok
test telemetry::tests::clickhouse_breaker_sheds_after_threshold_failures ... ok

test result: ok. 66 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.76s

     Running unittests src/bin/load_test.rs (target/debug/deps/load_test-3a24fd5dee8f57f0)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/main.rs (target/debug/deps/maple_ingest-b89fa52019d5d48f)

running 53 tests
test autumn::tests::flat_overage_allows ... ok
test autumn::tests::allowed_only_no_balance_field ... ok
test autumn::tests::flat_hardcap_with_remaining_allows ... ok
test autumn::tests::flat_sub_one_gb_remaining_still_allows ... ok
test autumn::tests::flat_hardcap_depleted_blocks ... ok
test autumn::tests::flat_unlimited_allows ... ok
test autumn::tests::nested_balance_object_depleted_blocks ... ok
test autumn::tests::nested_balance_object_with_remaining_allows ... ok
test autumn::tests::nested_overage_allows ... ok
test autumn::tests::null_balance_no_subscription_blocks ... ok
test tests::api_error_from_pipeline_maps_variants_to_status ... ok
test tests::api_error_kind_maps_status_to_stable_label ... ok
test tests::caller_fault_rejections_do_not_mark_the_span_error ... ok
test autumn::tests::unrecognized_shape_returns_none ... ok
test tests::clickhouse_destination_is_terminal_in_dual_mode ... ok
test tests::clickhouse_destination_uses_native_pipeline_even_in_forward_mode ... ok
test tests::cloudflare_ndjson_payload_parses_multiple_records ... ok
test tests::cloudflare_log_record_maps_body_severity_and_attributes ... ok
test tests::cloudflare_timestamps_support_rfc3339_unix_and_unix_nano ... ok
test tests::clickhouse_target_resolver_requires_current_schema ... ok
test tests::cloudflare_validation_payload_is_detected ... ok
test tests::clickhouse_target_resolver_rejects_password_over_http ... ok
test tests::clickhouse_target_resolver_decrypts_current_schema_password ... ok
test tests::data_loss_rejections_mark_the_span_error_even_at_4xx ... ok
test tests::decrypt_aes256_gcm_matches_node_crypto_fixture ... ok
test tests::data_loss_labels_match_the_kinds_the_gateway_emits ... ok
test tests::empty_export_request_is_accepted ... ok
test tests::enrichment_overwrites_tenant_fields ... ok
test tests::extract_ingest_key_returns_sentinel_literal_unchanged ... ok
test tests::enrichment_applies_to_a_payload_with_no_resource ... ok
test tests::hash_is_deterministic ... ok
test tests::malformed_payload_is_rejected_with_the_parser_reason ... ok
test tests::lenient_log_payload_is_accepted ... ok
test tests::numeric_nanos_no_longer_silently_empty_a_metric ... ok
test tests::pipeline_error_fault_split_matches_http_status ... ok
test tests::rejection_reason_is_bounded ... ok
test tests::replay_budget_disabled_when_limit_is_zero ... ok
test tests::replay_budget_truncates_session_at_its_ceiling ... ok
test tests::replay_budget_scopes_totals_per_session_and_org ... ok
test tests::resolve_ingest_key_keeps_stale_schema_on_managed_native_path ... ok
test tests::resolve_ingest_key_returns_none_when_hash_missing ... ok
test tests::resolve_ingest_key_returns_self_managed_false_when_no_settings_row ... ok
test tests::resolve_ingest_key_returns_self_managed_true_when_active_settings_row ... ok
test tests::resolve_connector_refreshes_routing_before_auth_cache_expires ... ok
test tests::resolve_ingest_key_refreshes_routing_before_auth_cache_expires ... ok
test tests::sentinel_token_matches_only_exact_literal ... ok
test tests::server_faults_stay_error ... ok
test tests::tinybird_destination_keeps_forward_mode_on_forward_path ... ok
test tests::spec_compliant_payloads_still_decode ... ok
test tests::resolve_ingest_key_serves_last_known_routing_when_refresh_fails ... ok
test autumn::tests::fails_open_on_transport_error ... ok
test tests::native_request_emits_a_span_per_pipeline_stage ... ok
test tests::forward_mode_switches_ready_org_to_clickhouse_without_forwarding_again ... ok

test result: ok. 53 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s

   Doc-tests maple_ingest

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

@railway-app
railway-app Bot temporarily deployed to maple / production July 22, 2026 08:41 Inactive
JeremyFunk and others added 2 commits July 22, 2026 11:38
An empty Schema.Struct({}) compiles to `{ anyOf: [{type:object},{type:array}] }`
in effect 4.0.0-beta.93, with no top-level `type: "object"`. Strict MCP clients
(the Vercel AI SDK used by the eve Slack agent) validate each tool's
inputSchema.type against z.literal("object"), so list_source_repositories (tool
#40) fails to parse and aborts the ENTIRE tools/list response — dropping every
Maple tool from the connection.

Normalize a no-property struct to an explicit empty object schema centrally in
toInputSchema so all current and future no-param tools stay MCP-compliant. Add a
test asserting every registered tool emits inputSchema.type === "object".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
All deployed stages share the maple.dev registrable domain, but PR
previews/staging run the dev Clerk instance while prod runs the
production one. Both write __client_uat cookies on Domain=maple.dev, so
browsing multiple environments makes the instances overwrite each
other's session hints and ClerkJS handshakes against the wrong frontend
API — surfacing as transient 403s on app-pr-N/api-pr-N and prod.

Purge foreign-instance parent-domain __client_uat* cookies (suffix
derived from the publishable key, mirroring @clerk/shared) before
ClerkJS initializes. Mitigation until preview/staging move to their own
registrable domain, per Clerk's same-domain limitation.

Also document the channels:history Slack bot scope in the slack-agent
README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to maple / production July 22, 2026 09:41 Inactive
Resolve drizzle migration-numbering collision: both branches added a 0017.
Renumber this branch's slack_workspaces migration to 0019 (regenerated via
drizzle-kit onto main's 0017/0018 chain). Add slack entry to main's new
useIntegrationOverviews() hook.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shape proxy only treated a missing ELECTRIC_URL as "not configured".
A deploy with ELECTRIC_URL + ELECTRIC_SOURCE_ID but no ELECTRIC_SECRET
(e.g. a PR preview inheriting shared Infisical Electric config while its
per-PR source step is skipped) forwarded an unauthenticated request to
Electric Cloud, which returns 401 MISSING_SECRET — surfacing as a hard-
broken shape stream in the browser instead of graceful degradation.

Treat incoherent Cloud credentials (exactly one of source_id/secret) as
not-configured and take the existing 503 path, and log the misconfig for
telemetry. Adds isElectricConfigCoherent + unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to maple / production July 22, 2026 11:34 Inactive
# Conflicts:
#	apps/web/src/routes/integrations.tsx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
From the PR #255 code + security reviews:

- reset-preview-branch.ts: refuse to run outside CI without
  RESET_PREVIEW_CONFIRM=1 — the script empties whatever DATABASE_URL points
  at and the connected role inherits postgres, so a stray prod/stg URL in a
  developer shell must not be enough to gut a real database
- reset-preview-branch.ts: drop migration-created extra schemas (owned by
  postgres post-normalization; vendor/system schemas untouched) so a replayed
  CREATE SCHEMA migration can't wedge every subsequent deploy with no
  recreate fallback
- reset-preview-branch.ts: run the inactive-replication-slot sweep over the
  replication-role connection (REPLICATION_DATABASE_URL) — the main role
  deliberately lacks the REPLICATION attribute, so the old sweep could never
  actually drop a slot; warn loudly on failure (a stale slot pins WAL)
- planetscale-pr-branch.ts: mint the Electric replication credential before
  the reset and pass it through; mask the full exported connection URLs, not
  just the raw passwords (encodeURIComponent can defeat raw-password masking)
- planetscale-pr-branch.ts: drop the dead ALTER SYSTEM fallback (equally
  permission-denied on PlanetScale) and downgrade the params-convergence
  timeout from a deploy-failing error to a warning — Electric activates
  without the params (run 30055008127)
- electric-pr-branch.ts: append sslmode=require when the URL never carried an
  sslmode param (previously only replaced an existing one); fail fast when
  `services create` returns no service id instead of dying later with a
  misleading get-secret error
- all three sweeps: hard-fail when GITHUB_REPOSITORY/GITHUB_TOKEN are absent —
  a token-less sweep resolves every PR to "unknown", skips everything, and
  green-no-ops forever, which is the exact failure class the safety net
  exists to catch
- comment fixes: nonexistent mintReplicationCredential reference, stale
  MAPLE_PG_URL mention in the Electric workflow step, single-repo naming
  caveat on the sweep workflow

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to maple / production July 24, 2026 00:39 Inactive
JeremyFunk and others added 6 commits July 24, 2026 12:01
- Wrap slack-bot blocks in a colored attachment so the severity bar
  renders (parity with the webhook destination)
- Truncate the default header to Slack's 150-char limit (long rule
  names previously failed delivery with invalid_blocks)
- Escape mrkdwn control chars in rule names, group keys, incident ids
- Replace the five-field dump with a lead summary sentence + compact
  fields (emoji-paired capitalized severity; group only when set)
- Add a context footer with incident ref and <!date^…> local-time stamp
- Full one-line notification fallback text instead of "rule: Triggered"
- Button styles per Slack guidance: primary on Open in Maple, no danger
  on navigation links

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/cleanup-preview-orphans.yml
#	packages/db/scripts/normalize-preview-ownership.ts
#	packages/db/scripts/reset-preview-branch.ts
#	scripts/electric-pr-branch.ts
…d format

A rule that customizes only the title (or only the body) has its other
field filled from the built-in defaults, which still produced the old
five-line field dump — so partially-templated rules kept sending the
old-style "basic" message. Update DEFAULT_BODY_TEMPLATE and the rule
editor placeholder to the lead-sentence format the designed blocks use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With attachments and no top-level blocks, chat.postMessage renders the
top-level text in-channel above the color bar (confirmed on the PR-246
preview). Move the notification-preview one-liner into the attachment's
fallback field, which Slack uses only for push/desktop previews.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	apps/electric-sync/src/routes/shape.http.ts
#	apps/web/src/routes/integrations.tsx
#	package.json
#	packages/db/drizzle/meta/0019_snapshot.json
#	packages/db/drizzle/meta/_journal.json
@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

🍁 Maple PR preview

Note

Preview resources were removed when this pull request closed.

Final commit c2a7a26 · View workflow run

JeremyFunk and others added 19 commits July 27, 2026 13:31
# Conflicts:
#	apps/api/src/routes/v2/config-resources.http.test.ts
#	apps/api/src/routes/v2/v2-test-support.ts
#	apps/electric-sync/src/routes/shape.test.ts
#	apps/web/src/components/chat/chat-conversation.tsx
#	apps/web/src/components/chat/chat-transcript.test.tsx
#	apps/web/src/components/replays/replays-toolbar.tsx
#	apps/web/src/routes/integrations.tsx
#	apps/web/src/routes/replays/$sessionId.tsx
#	docs/electric-sync.md
#	packages/db/drizzle/meta/0022_snapshot.json
#	packages/db/drizzle/meta/_journal.json
Port of chat-flue's splitToolResult change from main: Maple's MCP server
emits a second content entry per tool result carrying the web chat's
structured UI payload (createDualContent, tagged __maple_ui). chat-flue
now splits it off client-side; eve has no result-transform hook, so the
Slack agent's model was receiving the raw UI JSON duplicated next to the
text report on every Maple tool call. Extend the vendored eve patch to
drop those entries in McpConnectionClient.executeTool, with a canary
test alongside the botToken one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…y bot

Review fixes (multi-agent effect-review-v4 + general review):
- SlackIntegrationService: probeAndRevokeIfDead no longer counts a failed
  DB revoke as revoked (logs and returns false); uninstall's revocation
  update is now a compare-and-set with one retry so a concurrent reinstall
  can't be clobbered while its fresh API key survives unrevoked;
  Service.of() construction; Arr.map/Arr.filter over native methods
- slack-bot-token: SlackBotTokenResolver.of() construction
- integrations.http.test: complete the 8-method die-stub
- slack-agent thread-follow-up: bound conversations.replies with
  oldest/latest so the engagement window is correct for >100-reply
  threads; single ~2s promotion deadline inside Slack's ack budget
- slack-agent maple.ts: type-check resolve payload fields; render_chart:
  reject non-finite point values

Also lands the events-intake refactor: SlackEventsRouter is removed from
the API (Slack allows one Events URL per app, already pointed at the bot);
the bot detects app_uninstalled/tokens_revoked (uninstall-detection.ts,
bot-token-scoped) and calls POST /internal/slack/workspaces/:teamId/revoke,
with the 6-hourly reconcile cron as backstop. SLACK_SIGNING_SECRET leaves
the API env.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rness

AllV2GroupLayersLive now includes HttpV2SlackIntegrationsLive, so every
harness composing it must stub SlackIntegrationService; setup-audit was
the one file missed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Machine-local preference, not a project rule — belongs in the owner's
CLAUDE.local.md or ~/.claude/CLAUDE.md instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When the Maple app is removed (or its tokens revoked) from Slack's own
UI, the integration card silently reverted to the never-installed state,
which read as a Maple bug. Persist why a workspace row was revoked
(revoked_reason: uninstalled / superseded / app_uninstalled /
tokens_revoked / reconciliation), expose the remote reasons on the v2
status endpoint (disconnected_reason / _team_name / _at), and show a
warning banner on the card explaining the disconnect came from Slack's
side. Dashboard uninstalls and replacement installs still read as plain
not-installed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch was previously deployed

2 inactive deployments
pr-preview — c2a7a26f Deployed Jul 28, 2026 by JeremyFunk via deploy-pr-preview #1122
maple / production — c2a7a26f Deployed Jul 28, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant