Add ode cron/send/messages/reaction CLIs, retire /api/action#189
Merged
Add ode cron/send/messages/reaction CLIs, retire /api/action#189
Conversation
added 2 commits
April 18, 2026 15:26
- New `ode cron` CLI mirrors `ode task`: create/list/show/update/enable/disable/run/delete backed by new GET /api/cron-jobs/:id and PATCH /api/cron-jobs/:id routes and a patchCronJob() helper in the cron-jobs store. - New `ode send file` CLI uploads files/images to any configured channel; the daemon resolves Slack/Discord/Lark from the channelId and dispatches to dedicated uploadSlackFile / uploadDiscordFile / uploadLarkFile helpers. - Removed the per-platform `upload_file` branch from /api/action and from each ims adapter; system prompt in packages/agents/shared.ts no longer advertises it and now documents ode cron, ode send, plus a dedicated VISUAL TESTING section telling agents to drop screenshots back into the current thread. - AGENTS.md gains matching cron/send sections; discord/lark api tests switched to exercise the new upload helpers directly.
Replaces the last remaining uses of the generic /api/action dispatcher with dedicated Ode CLIs: - ode messages get <threadId> --channel <channelId> (fetch thread replies) - ode reaction add <messageId> --channel ... --emoji (react to a message) Both commands auto-resolve Slack / Discord / Lark from the channel's configured workspace, matching how ode task / ode cron / ode send work. Server: - New /api/messages/thread and /api/reactions routes. - Shared channel-resolver.ts used by send/messages/reactions routes. - Remove /api/action route and its per-platform handleSlackActionPayload / handleDiscordActionPayload / handleLarkActionPayload dispatchers. - Slack / Discord / Lark api.ts files now expose only the focused helpers that back the CLIs (uploadX, getXThreadMessages, addXReaction) plus postSlackQuestion for SDK-emitted question events. Config cleanup: - Drop getSlackActionApiUrl and odeSlackApiUrl wiring; system prompt no longer advertises the raw action endpoint to agents. System prompt: - Rework ODE CLI section to describe task / cron / send / messages / reaction together, with per-tool flags and current-thread examples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ode cronCLI (create/list/show/update/enable/disable/run/delete) mirrorsode task, backed byGET /api/cron-jobs/:id+PATCH /api/cron-jobs/:idand apatchCronJob()helper.ode send file <path> --channel ... [--thread ...] [--filename ...] [--title ...] [--comment ...]uploads files/images.ode messages get <threadId> --channel <channelId> [--limit N] [--json]fetches thread replies.ode reaction add <messageId> --channel ... --emoji thumbsup|eyes|ok_handadds reactions./api/actionbridge and the short-lived/api/send/file//api/messages/thread//api/reactionsroutes.ode send/ode messages/ode reactionnow call the Slack/Discord/Lark SDK helpers directly from the CLI process — no daemon round-trip, no HTTP hop.CLI now drives Slack/Discord/Lark directly
packages/core/cli-handlers/channel-resolver.ts— resolves a<channelId>/<workspaceId>::<channelId>locator to(platform, workspaceId, channelId, credentials)by readinggetWorkspaces()from the on-disk Ode config. Works without a running daemon.packages/core/cli-handlers/flags.ts— shared--flag/positional parser used by send / messages / reaction.packages/core/cli-handlers/send.ts,messages.ts,reaction.ts— calluploadSlackFile/getSlackThreadMessages/addSlackReaction(and Discord/Lark counterparts) directly with the resolved credentials.Platform helpers
packages/ims/slack/api.ts):uploadSlackFile,getSlackThreadMessages,addSlackReactionnow take abotTokenargument and use rawfetch(conversations.replies, reactions.add, files.*), so they run fine from the CLI process without a Bolt App.postSlackQuestionis unchanged (daemon-only, still usesgetApp().client).packages/ims/discord/api.ts):uploadDiscordFile,getDiscordThreadMessages,addDiscordReaction.packages/ims/lark/api.ts):uploadLarkFile,getLarkThreadMessages,addLarkReaction.handle*ActionPayload/*ActionRequest/*ApiResponseexports removed.Removed
/api/action,/api/send/file,/api/messages/thread,/api/reactionsroutes and their registrars.packages/core/web/routes/channel-resolver.ts,attachDiscordBotToken/attachLarkCredentials(only the retired routes used them).getSlackActionApiUrl()/odeSlackApiUrlwiring — the system prompt no longer mentions any HTTP endpoint.System prompt / docs
packages/agents/shared.tsrewrites the ODE CLI section so it describesode task/ode cron/ode send/ode messages/ode reactiontogether, with the current channel + thread pre-filled in the examples.AGENTS.mdgainsFetching MessagesandReactionssections plus a "Platform APIs" note stating Ode exposes no HTTP bridge for chat actions — agents drive chat platforms only through theodeCLI verbs.Tests
packages/ims/{discord,lark,slack}/api.test.tscover the new per-platform helpers.packages/agents/test/cli-command.test.tsupdated assertions (noupload_file, no/api/action).bun test— 267 pass, 1 skip, 0 fail.