mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 20:17:56 +00:00
fix: don't repurpose tokenCount as budget, normalize workspaceDir in hook ctx
- Remove tokenCount from before_compaction in engine-owned path since we don't have actual transcript token counts (was incorrectly set to budget). tokenCount is optional in the hook type. - Resolve workspaceDir via resolveUserPath() to match the normalized path used in compactEmbeddedPiSessionDirect.
This commit is contained in:
committed by
Josh Lehman
parent
d105436c60
commit
054ded7b02
@@ -952,7 +952,7 @@ export async function compactEmbeddedPiSession(
|
||||
sessionId: params.sessionId,
|
||||
agentId: sessionAgentId,
|
||||
sessionKey: hookSessionKey,
|
||||
workspaceDir: params.workspaceDir,
|
||||
workspaceDir: resolveUserPath(params.workspaceDir),
|
||||
messageProvider: resolvedMessageProvider,
|
||||
};
|
||||
// Engine-owned compaction doesn't load the transcript at this level, so
|
||||
@@ -963,7 +963,6 @@ export async function compactEmbeddedPiSession(
|
||||
await hookRunner.runBeforeCompaction(
|
||||
{
|
||||
messageCount: -1,
|
||||
tokenCount: ceCtxInfo.tokens,
|
||||
sessionFile: params.sessionFile,
|
||||
},
|
||||
hookCtx,
|
||||
|
||||
Reference in New Issue
Block a user