aws-samples / aws-samples/remote-swe-agents

Limit token usage limit per session

Open
#287 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
243
Forks
50
Avg merge
1h 19m
Merged PRs (30d)
24

Description

We want to limit the token usage per session (e.g. force stop an agent if it consumes more than $5.)

# Todo
1. Create global config page on webapp. We can rename the current common prompt page for this.
2. Save the pricing threshold on dynamodb.
3. Worker loads the config when starting it's turn.
4. Worker ends it's loop when the cost exceeds the limit.
5. Users can set new cost limit per session to continue the session.

Managing cost limit per session can be too complicated. We'll postpone this implementation until enough feedback is gathered.

Contributor guide

Open the contributing guide

Research direction

Start with the webapp's current common prompt page, then trace how worker turns begin and how session state is stored in DynamoDB. Review the postponed requirements for configuration, threshold persistence, worker stopping, and continuing a session. Done means users can set a per-session cost limit and the worker stops and can continue when the limit is exceeded.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
backend, cloud, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.