stacklok / stacklok/mecatl

Slack bot: enforce per-run token and spend budgets

Open
#1,396 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

Summary

Apply a tighten-only token or spend budget to every run started by the Slack
bot.

The existing per-user request-rate limit bounds prompt frequency. It does not
bound the cost of one accepted run. Mecatl supports run limits internally, but
the Slack integration does not have a supported SDK option for applying a
per-run limit.

Scope

  • Define the supported server and TypeScript SDK path for a caller-supplied,
    tighten-only per-run limit.
  • Configure the Slack bot with an operator-controlled default limit.
  • Apply the limit to every DM and channel run without weakening stricter
    server policy.
  • Report a budget terminal outcome to the requesting Slack user without
    exposing internal diagnostics or credentials.
  • Document how the run budget relates to the existing per-user request-rate
    limit.
  • Add SDK and Slack integration tests for the configured limit and terminal
    behavior.

Completion criteria

  • Every Slack-started run receives the configured limit.
  • The bot cannot raise a stricter server-owned limit.
  • Budget exhaustion produces a bounded, user-scoped Slack response.

References

  • #883 and the budget TODO in
    sdk/typescript/examples/slack-bot/src/bridge.ts.
  • The Slack bot integration roadmap parent.

Fully or partially written by an AI agent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the budget TODO in sdk/typescript/examples/slack-bot/src/bridge.ts and review reference #883 and the Slack bot integration roadmap. Trace the supported server and TypeScript SDK path for caller-supplied tighten-only limits, then add the requested SDK and Slack integration tests. Done means every Slack run receives the configured limit, stricter server policy cannot be weakened, and budget exhaustion produces a bounded user-scoped response.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
api, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.