feat: add native skill tool with permission system (#5930)

Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
Mohammad Alhashemi
2025-12-23 02:24:06 +03:00
committed by GitHub
parent b9029afa22
commit 046e351140
12 changed files with 180 additions and 298 deletions

View File

@@ -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