feat: auto-delete old conversations, and stop a tool call that repeats (#15)
This commit was merged in pull request #15.
This commit is contained in:
+25
-1
@@ -16,8 +16,32 @@ export const STORAGE_SESSION_PREFIX = "lam.session.";
|
||||
* preamble the model had written was discarded, and the turn ended with a notice
|
||||
* about the limit rather than an answer. The closing round in `agent.ts` now
|
||||
* turns that into an answer, and this is the room it gets to gather first.
|
||||
*
|
||||
* A default rather than a ceiling: the Tool Call Limit preference overrides it,
|
||||
* and "Unlimited" removes it entirely.
|
||||
*/
|
||||
export const MAX_TOOL_ITERATIONS = 8;
|
||||
export const DEFAULT_MAX_TOOL_ROUNDS = 8;
|
||||
|
||||
/**
|
||||
* How many times one turn may ask for the exact same call before the loop gives
|
||||
* up on it.
|
||||
*
|
||||
* A model stuck in a rut repeats itself with identical arguments, so the repeat
|
||||
* is the signal: the third time it asks the same question it is not going to
|
||||
* learn anything new, and the only thing a fourth round buys is another round.
|
||||
* This is the backstop the rounds cap cannot be, because the cap can be set to
|
||||
* Unlimited.
|
||||
*/
|
||||
export const MAX_REPEATED_TOOL_CALLS = 3;
|
||||
|
||||
/**
|
||||
* How long a snip must sit unreferenced before the orphan sweep collects it.
|
||||
*
|
||||
* Snips are written to disk before the chat view opens, and a capture the user
|
||||
* never sends is stored nowhere. The wait is what keeps the sweep from deleting
|
||||
* the file out from under a snip the user is still deciding what to ask about.
|
||||
*/
|
||||
export const SNIP_ORPHAN_GRACE_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
/** Oldest sessions past this count are evicted, along with their storage keys. */
|
||||
export const MAX_SESSIONS = 100;
|
||||
|
||||
Reference in New Issue
Block a user