AS AgentScopeAPI 手册 / API Reference

SessionFreshnessEvaluator

public final class SessionFreshnessEvaluator
源码Source io/agentscope/harness/coding/session/SessionFreshnessEvaluator.java:36–92

会话 Freshness 评估器,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.coding.session 包。核心成员包括 evaluate。

Evaluates whether a session is still "fresh" based on its last activity time and the configured SessionResetPolicy. Mirrors OpenClaw's evaluateSessionFreshness.

Two independent staleness criteria:

  • Daily reset: stale if updatedAt is before the most recent daily boundary at policy.dailyResetHour() in the system default timezone.

  • Idle timeout: stale if now exceeds updatedAt + idleMinutes * 60_000.

If either criterion triggers, the session is considered stale (fresh = false).

方法摘要Method Summary

方法Method说明Description
public static SessionFreshness evaluate(long updatedAtMs, long nowMs, SessionResetPolicy policy)
static
执行 `evaluate` 方法。
Evaluates freshness of a session.

方法详情Method Detail

evaluate

public static SessionFreshness evaluate(long updatedAtMs, long nowMs, SessionResetPolicy policy)
static

执行 evaluate 方法。

Evaluates freshness of a session.

参数Parameters
名称Name类型Type说明Description
updatedAtMslong已更新 At Ms(类型 `long`)。the session's last activity timestamp (epoch millis)
nowMslong当前时间 Ms(类型 `long`)。the current time (epoch millis)
policySessionResetPolicy策略(类型 `SessionResetPolicy`)。the reset policy to apply
返回Returns SessionFreshness
返回SessionFreshness。freshness evaluation result
源码Source io/agentscope/harness/coding/session/SessionFreshnessEvaluator.java:48–76
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.