8000 feat(slack): create and keep the Slack app configured from mikan's manifest by geminixiang · Pull Request #179 · geminixiang/mikan · GitHub
[go: up one dir, main page]

Skip to content

feat(slack): create and keep the Slack app configured from mikan's manifest - #179

Merged
geminixiang merged 1 commit into
mainfrom
feat/slack-app-sync
Oct 12, 2026
Merged

geminixiang merged 1 commit into
mainfrom
feat/slack-app-sync

Conversation

@geminixiang
@geminixiang geminixiang commented Oct 12, 2026 •
Copy link
Copy Markdown
Owner

What

mikan creates and keeps its Slack app configured (ADR 0026).

  • Each release carries the Slack app manifest it needs (src/adapters/slack/app-config.ts, slash commands derived from the command manifest; deploy/examples/slack-app-manifest.json is tested to equal it).
  • With a Slack app configuration token stored in the state directory, every start rotates the token, finds the app from the bot token, exports the live manifest, and replaces it when it differs. New slash commands, scopes, and events need no edit in Slack's settings; settings added by hand are removed.
  • When an update needs a scope the bot token lacks, mikan DMs the token's owner a reinstall link once.
  • mikan slack token stores a token for an existing app; mikan slack set --name … --description … writes ~/.mikan/slack.json (display fields only, Slack's limits enforced).
  • mikan onboard can create the app from the manifest, print the install link and the app-level token steps, and delete the app again if onboarding is declined afterwards.
  • Without a token nothing changes. Sync failures log one warning and never stop startup (15 s timeout, no retries).

Acceptance eval (real Slack API, test app)

# Scenario 1.4.0 This branch
S1 No configuration token Slack untouched Slack untouched
S2 Live app missing /pi-desktop still missing added on start
S3 Hand-added scope, event, command kept removed
S4 mikan slack set --name … --description … no CLI applied; all other fields equal the built-in manifest
S5 Live app already matches no change no update, logs "already matches"
S6 Built-in manifest adds a scope — scope added; one DM with the reinstall link
S7 Stored access token expired — rotated, saved 0600, synced
S8 Invalid refresh token starts starts, one warning naming the cause
S9 CLI option outside display fields no CLI refused, nothing written
S10 mikan onboard creates the app no creation created with the chosen name; install link printed; declined before creation creates nothing; declined after creation deletes the app
S11 Daemon on a newly created app — not run: needs a person to install the app and create its xapp- token
S12 Existing app joins with mikan slack token no CLI next start removes the hand-added settings

Findings that shaped the code:

  • Every rotation revokes the previous access token, including one held by another process, so the new pair is saved first and one token serves one install.
  • Slack adds features.app_home.agent_tasks_enabled: true to new apps and ignores the value sent; the comparison skips it, otherwise every start would update the app.
  • Apps built from the agent manifest would lose the agent surface once a token is stored; the docs say so.

Verification

  • Gate: lint, fmt, knip, build, typecheck, tests (2169 passed)
  • CI
  • Slack E2E: 26 of 26 (startup path changed; CI has no configuration token, so it covers the unchanged no-token path)

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mikan with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7bdd5cb
Status: ✅  Deploy successful!
Preview URL: https://f2c7997e.mikan-1wv.pages.dev
Branch Preview URL: https://feat-slack-app-sync.mikan-1wv.pages.dev

View logs

@geminixiang
geminixiang merged commit 28393d4 into main Oct 12, 2026
7 checks passed
@geminixiang
geminixiang deleted the feat/slack-app-sync branch October 12, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0