stacklok / stacklok/mecatl

feat(mecatui): expose run and team token budgets in embedded configuration

Open
#686 0 comments 0 reactions 1 assignee View on GitHub

@JAORMX is already working on this.

Since Sep 7, 2026.

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

Description

Problem

mecated exposes --max-run-tokens and --max-team-tokens, but the mecatui embedded-server configuration leaves app.Config.MaxRunTokens and app.Config.MaxTeamTokens at their zero values. This makes both budget brakes unlimited in the default local TUI, and there is no operator config-file way to set them.

Desired change

Add operator-tier configuration-file support for the embedded mecatui server per-engine and team-wide token ceilings. The configuration should map through mecatui resolved config into app.Config.MaxRunTokens and app.Config.MaxTeamTokens.

Acceptance criteria

  • The operator settings file can configure a positive per-engine run-token ceiling and a positive team-wide token ceiling for embedded mecatui.
  • Absent settings retain current behavior: 0 / unlimited.
  • Invalid values fail closed or are reported consistently with existing settings parsing conventions.
  • The values reach app.Config.MaxRunTokens and app.Config.MaxTeamTokens; the existing inherited/tighten-only budget semantics remain unchanged.
  • Configuration precedence and operator-vs-project trust treatment are documented and covered by tests.
  • User-facing mecatui documentation explains the settings and their distinction from child per-call max_run_tokens.

Context

Current mecated flags: cmd/mecated/main.go:1417-1418. Mecatui has no corresponding fields/flags and its embeddedConfig does not set the app config values: cmd/mecatui/config.go, cmd/mecatui/main.go (embeddedConfig). The budget behavior itself is already implemented in engine/agent/loop.go (effectiveMaxRunTokens, budgetExhausted) and team supervisor code; this is composition/config plumbing, not new budgeting behavior.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.