Skip to content

A run-level cost limit, so hosts don't watch events to enforce one #266

Open

Description

@deepfates

A host that wants to cap what one program run spends has to watch Imp.Run's events from outside and cancel the run when the total crosses its limit. Dwell does exactly that for its per-turn spend cap. Any Imp program could want the same limit, so it belongs on the run itself: an option such as max_cost that ends the run with a clear outcome when the running total of cost (or estimated_cost where there's no charge) passes it. The run should also record which figure it counted.

Done when:

  • an Imp run with a cost limit stops at the limit and reports why;
  • the tests cover both a charged total and an estimated one;
  • a host such as Dwell can pass its limit in and delete its own watcher.

Activity

  1. deepfates commented on Oct 8, 2026

    @deepfates
    OwnerAuthor

    Triage, 2026-10-08: still open. Imp.Run has no run-level cost limit on main (b736d00). Dwell still enforces its per-turn spend cap and its daily cap (GroveResearch/delven#24, $5 per resident) by watching events from outside.

    This matters for the residents' cost. GroveResearch/dwell#203 recorded one kimik3 turn that made 50 model calls for $1.04 after its reply was refused. GroveResearch/delven#29 found the daily cap refusing 43–71% of wakes for four residents. Spend caps are frozen until harness v2 is measured (GroveResearch/delven#31), so this belongs after that release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions