mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-07 01:08:58 +00:00
feat: add native skill tool with permission system (#5930)
Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
committed by
GitHub
parent
b9029afa22
commit
046e351140
@@ -40,6 +40,8 @@ export namespace SessionCompaction {
|
||||
export const PRUNE_MINIMUM = 20_000
|
||||
export const PRUNE_PROTECT = 40_000
|
||||
|
||||
const PRUNE_PROTECTED_TOOLS = ["skill"]
|
||||
|
||||
// goes backwards through parts until there are 40_000 tokens worth of tool
|
||||
// calls. then erases output of previous tool calls. idea is to throw away old
|
||||
// tool calls that are no longer relevant.
|
||||
@@ -61,6 +63,8 @@ export namespace SessionCompaction {
|
||||
const part = msg.parts[partIndex]
|
||||
if (part.type === "tool")
|
||||
if (part.state.status === "completed") {
|
||||
if (PRUNE_PROTECTED_TOOLS.includes(part.tool)) continue
|
||||
|
||||
if (part.state.time.compacted) break loop
|
||||
const estimate = Token.estimate(part.state.output)
|
||||
total += estimate
|
||||
|
||||
Reference in New Issue
Block a user