Replies: 1 comment
|
I do not think the constructor-seed boundary is dropping the routed header in
That makes option 1 the existing invariant rather than a new fix, and an additional I suggest tightening the regression before changing the design: const handle = await ctx.agents.resume({ resumeSessionId, agentOptions })
const resumed = handle.agent
expect(resumed.session.requestHeader()?.config).toMatchObject({
provider: expectedProvider,
model: expectedModel,
})
expect(ctx.tokenMeter.measure(resumed.session).totalTokens)
.toBeGreaterThanOrEqual(expectedThreshold)Then dispatch the first resumed step and assert the compaction bracket.
For a genuinely headerless legacy artifact, I would prefer an explicit migration policy (or intentionally waiting until the first completed routed request) over treating |
Uh oh!
There was an error while loading. Please reload this page.
Environment
dsh-v0.1.2-alpha.4standardpresetopenai-codex/gpt-5.6-sol1,047,576thresholdRatio: 0.20,retainRatio: 0.08Observed behavior
A persisted long-running session was resumed after restarting the Desktop host. On its first resumed turn, the context meter was already approximately
611,624tokens, well above the approximately209,515pressure threshold. The session later reached857,565tokens (81.9%of the model context window).Across the complete session log there were zero
compaction/start,compaction/summary, orcompaction/endevents. The resumed requests were durably routed to the same provider/model, and the updated standard preset/runtime prompt was present, so the new runtime and intended policy were active.A composition-level check confirms that a newly created agent mounted from
standardreceivesagent/pre-stepand invokescompactIfNeeded(). The gap therefore appears specific to resumed session state or pressure target resolution, rather than the preset row being absent globally.Suspected boundary
BasicCompactionEngine.compactIfNeeded()resolves proactive pressure only through:A resumed Session starts a new constructor-seed epoch. If
session.requestHeader()intentionally exposes no header before the first new request header in that epoch, the first resumed pre-step can silently skip pressure compaction even though the resumed Agent already carries its restored provider/model route.A local workaround is to fall back to the Agent route for this specific resume window, but an existing unit test explicitly protects the opposite invariant: headerless pressure must not use
AgentOptions. I therefore do not think a broad fallback is appropriate without clarifying the intended durable-route contract.Questions / suggested fix direction
Would the preferred fix be one of these?
resumeRouteowned by Agent construction and usable only until the first newrequest/header.A regression test should use real persistence preparation plus
ctx.agents.resume(), mount the shippedstandardpreset, dispatch the first resumed step above threshold, and assert that a compaction bracket is recorded. A normal newly-created/headerless session should retain the current safety behavior.This materially affects long-running task sessions: without early compaction, every subsequent model request carries hundreds of thousands of avoidable tokens and can become progressively slower or fail before overflow recovery runs.
All reactions