Skip to content

Team cost controls: per-team activity budget (C) and quiet hours / mute (E) — A and D are shipped #645

Closed

Description

@hsliuustc0106

What this is now

The original report — a team starting to work before the user asks — has been split up and partly shipped:

C. Per-team activity budget

A cap per team per day on turns and/or tokens, visible in the UI, with non-essential turns pausing when the budget is spent, and reporting back to on-demand only. The decisions this needs, none of which a Bot should make:

  • what the unit is (turns, tokens, or both — tokens cost money, turns measure noise);
  • what the default cap is for a fresh team, and whether 0 means "off" or "unlimited";
  • what counts as non-essential — scheduled reports, the daily tidy, proactive reminders — versus a direct message from the user, which must always go through;
  • where it is shown (inbox header, team overview, a settings row) and what it does at 100 %.

E. Quiet hours / mute

A team-level toggle that stops proactive turns (scheduled reports, tidy, reminders) while direct messages keep working. The decisions: whether it is a schedule (hours in the team's local time) or a plain toggle; whether a muted team still runs scheduled work with a zero-turn path; and whether a mute is visible to the Bots (so a coordinator does not think its child is broken).

What is already accepted (kept from the original report)

  • A user task costs a bounded number of turns that the budget exposes before it is spent.
  • A team can be muted so scheduled/proactive turns stop while direct messages still arrive.
  • No change to how a Bot answers once it is actually addressed.

Why this stays needs-human

Both halves change something the user sees and pays for: a cap that silently drops reporting, or a mute that makes a team look broken. The four decisions above are one sentence each from the user, and then each half becomes an agent-ready issue with a fixed shape.

Where the work lands when it is decided: settings/state for the budget and the toggle, core/src/host/schedules.js and the prompt layer for what counts as proactive, and the inbox/team view for the display.

Activity

  1. Birfy commented on Oct 22, 2026

    @Birfy
    Collaborator

    Triaged: four independent causes are described in one issue, which is why it cannot be picked up as is. Two answers turn it into a scoped PR.

    1. Scope now: which cause does this round cover — the creation kickoff, one-turn-per-message, proactive prompts, or the activity budget? One of them, or a specific pair.
    2. Product call: is "a newly created Bot does not greet until the user writes" acceptable behaviour? If yes, the kickoff half is a deletion and needs no budget; if no, the budget becomes the answer and this issue needs a number (turns per hour? per team?).

    Acceptance I would write once answered: for the kickoff half, creating a 3-Bot team and a group produces zero turns before the user writes, asserted on turn count in the bench; every existing test that pinned a kickoff greeting is updated with a note saying why.

    Written-by: Triage

  2. added
    needs-infoWaiting for the reporter or a maintainer decision
    on Oct 22, 2026
  3. Birfy commented on Oct 22, 2026

    @Birfy
    Collaborator

    Design decision (owner, 2026-10-22: decide the design in the issue instead of asking). The four causes are one PR's worth only if scoped to the first; this issue covers the kickoff, and the other three get their own issues when someone takes them.

    1. No turn before the user writes. A newly created Bot does not greet: remove the [Bot team setup] kickoff turn (core/src/host/delivery.js, role: 'kickoff'). A newly created group does not open a round either: remove roomKickoff and the opening speakers (core/src/host/groups.js). The user's first message is what starts work.
    2. Proactive prompts and the activity budget are out of scope here. They are separate behaviours (one-turn-per-message is A burst of messages opens one turn per message; there is no receive buffer #642); mixing them into this diff is how the "one issue, one PR" rule breaks.
    3. The Bot still exists and is usable immediately — this removes a greeting, not a capability; list_bots and the tree still see it.

    Acceptance (bench):

    • creating a 3-Bot team and one group produces zero turns until the first user message: assert on the turn count, not on text;
    • the first user message in a group produces exactly one turn from the admin (the existing opening-speaker behaviour applies from that message, not before it);
    • every test that pinned a kickoff greeting is updated, and the change note says why (the grep for kickoff must come back with no live call site).

    Red without the change: the first case shows 4+ turns (one per Bot plus the group round).

    Scope: core/src/host/delivery.js, core/src/host/groups.js, their tests, and the mirror under patches/ds-bot/ (generate then check). No setting, no UI change.

    Written-by: Triage

  4. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    and removed
    needs-infoWaiting for the reporter or a maintainer decision
    questionFurther information is requested
    on Oct 22, 2026
  5. Birfy commented on Oct 22, 2026

    @Birfy
    Collaborator

    Claiming: branch feat/645-no-kickoff-turns, from main.

    Scope is the kickoff half only, as decided in the issue: remove the [Bot team setup] turn a new Bot gets (core/src/host/roster.js, role: 'kickoff') and the opening round a new group sends (core/src/host/groups.js, roomKickoff + its opening speakers). The user's first message starts the work; one-turn-per-message (#642), proactive prompts and the activity budget stay out of this diff.

    Acceptance I will pin in the bench: creating 3 Bots and one group leaves the turn count at zero until a user message; the first user message in that group produces exactly one admin turn; every test that pinned a greeting is updated with the reason, and no live kickoff call site remains in core/src/host.

    Touches core/, so ds-bot-patches.mjs generate and check are part of done.

  6. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 22, 2026
  7. self-assigned this
    on Oct 22, 2026
  8. added
    agent-prPull request opened by an agent
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 22, 2026
  9. 10 remaining items

  10. Birfy commented on Oct 23, 2026

    @Birfy
    Collaborator

    Claim void: no branch or pull request exists, and the kickoff half already landed in #681.

  11. Birfy commented on Oct 25, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    E (quiet hours) is now #1166 — the owner ruled the split on 2026-10-25 with defaults written in: off unless switched on, a window in the team's local time, and direct messages and approval requests never suppressed. Owner: Dev3, agent-ready.

    C (per-team budget) is what is left here, and it still needs the user's four numbers — unit (turns / tokens / both), the default cap for a fresh team, what 0 means, and what counts as non-essential. Until those exist, C is not triageable: any card I wrote would be inventing the cap.

    Nothing else in this issue is being closed; A and D shipped, B has its own ticket.

  12. Birfy commented on Nov 6, 2026

    @Birfy
    Collaborator

    Written-by: Chief

    E (quiet hours) is #1166. What is left here is C, the per-team activity budget, and it needs your call on one thing before anyone can code it — the unit:

    A. 按轮次(turns)计:一队每天默认 200 轮,0 = 关闭预算;花完就只保留你直接发起的对话,定时报告和 tidy 停下。好处是它能直接压住「吵」这个毛病,接口里 turn 数已经现成;代价是它不反映钱,工具很贵的一轮和一问一答算同一份。

    B. 按 token 计:每天默认值按钱算,超了就停非必要轮次。好处是它直接对应账单,你对花费敏感时这个是对的;代价是同样的 200 轮可能今天够、明天不够,用起来更像限流而不是预算。

    我倾 A:这条 issue 的起因是「没人叫就开始工作」,那是轮次噪声,不是钱;要管钱的话 B 可以以后加一条并行指标。你回 A 或 B,我就把它写成带文件与验收的规格派出去。

  13. Birfy commented on Nov 7, 2026

    @Birfy
    Collaborator

    Written-by: Chief

    Owner decision 2026-11-07, option A: the budget counts turns. That answers Triage's four numbers:

    1. Unit — model turns dispatched for one team (turns, not tokens).
    2. Default cap — 200 turns per day for a fresh team.
    3. What 0 means — budget off, unlimited; and it is what an existing team gets until the field is set.
    4. What counts as non-essential — every turn the system starts by itself: a timer or scheduled report, a tidy / self-organization pass, a round started by a Bot, a kickoff.

    Behaviour

    • A team's turns are counted per team-local day (the team's configured time zone, Asia/Shanghai when unset) and the counter resets at that day's boundary.
    • Under the cap nothing changes.
    • At or over the cap, a turn the user starts themselves — their own message to a Bot, or a group message they wrote — is still dispatched. A system-started turn is not dispatched at all: no model call, no message to the user, one line in the host log.
    • 0 disables the budget.

    Scope — the turn dispatcher in core/src/host/ and the team record it reads, plus the settings surface that carries the number if the field is not there yet. The implementer names the exact files and lines in the PR body and keeps the diff inside that path. If a settings field is added, document it in docs/subsystems/team.md; otherwise carry a Docs-not-needed: trailer in both places.

    Acceptance — unit tests against the mock model (core/dev/mock-llm.mjs), each failing when the change is reverted:

    a) cap reached → a timer-started turn is not dispatched and the mock model sees no call;
    b) cap reached → a turn started by the user's own message is dispatched;
    c) 0 → no turn is refused;
    d) the count resets at the day boundary.

    agent-ready. E (quiet hours) is #1166 and stays there.

  14. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 7, 2026
  15. Birfy commented on Nov 7, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    Claimed #645 — branch feat/645-turn-budget, first step the pure day/record helpers in core/src/host/turn-budget.js (owner decision 2026-11-07, option A: 200 turns per team-local day, 0 = off, existing teams seeded off).

  16. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions