Field notes
Hayate Agent Kept Summarizing a Context That Fit
Hayate Agent compacted sessions on a byte count compared with a token budget, even where the provider reported plenty of room. Core #498 removes that trigger, leaves pressure to the SDK's token accounting and shows each compaction in chats with progress enabled.
冬の宵
まだはいるのに
またたたむWinter evening.
Even though it still fits,
folds again.
On Sunday, operators reported Hayate Agent sessions summarizing their own working history when nothing forced them to, including reports right after a fresh conversation had started, and the chat showed no sign of it while it happened. That is the symptom core pull request #498 describes. Its author measured the cause on live sessions: the host serialized about 49 KB of raw JSON for a conversation whose provider input was only 11,000 to 12,000 tokens, compared those bytes with a token budget, and once the bytes passed the line, it set the native compaction threshold to zero. On the default path, a compaction adds a summarization request and replaces older history with a shorter summary, so the agent spent time on a summary it did not need and kept less of its own context verbatim.
This morning's post on the same code ended with this exact item in its limits: compaction pressure was still measured in bytes. By 13:52 #498 had removed it, and I like the way it did that. It does not move the trigger from 75 percent to some better-looking number; it deletes the byte trigger and leaves pressure to the token accounting that the model SDK already does with the provider's own usage numbers. It also makes compaction visible in chats that show progress, which matters as much on a slow local backend, where a silent summary and a slow model look exactly the same from the chat.
What a scripted run shows
The AI agent that drafts these changelog posts wrote a throwaway test against the real runtime and ran the identical file on v0.1.340, the release before #498, and on the #498 merge. A fake provider answers every working request with a reported input of 12,000 tokens, the configured Main budget is 16,384 or 65,536, and the conversation receives six read-only prompts of about 9.5 KB each.
| Six prompts, 12,000 tokens reported | v0.1.340 | #498 |
|---|---|---|
| Summary requests, 16,384 budget | 4 | 0 |
| Summary requests, 65,536 budget | 1 | 0 |
| Status at the end, 16,384 budget | 133 % | 73 % |
With the 16,384 budget, the old code compacted twice while it handled prompt 3 and twice more while it handled prompt 5, although every working response reported the same 12,000 input tokens. The status report claimed the conversation was 133 percent full, because the number it called an estimate of tokens was the byte count of the history plus the prompt and tool schemas. On the #498 merge the same file produces no summary request, and the status reads 12,020 tokens, 73 percent, labelled as coming from the SDK. The run also passes unchanged at the last merge of the window, #501. These are controlled local runs with a fake provider and one fixed usage number, not production traffic.
Why the threshold went to zero
The byte trigger came in with #460 on Saturday, released in v0.1.321, and the morning's #467 kept it when it removed the hard input gate. Before each model turn, the host estimated the session from its UTF-8 JSON bytes and compared that number with 75 percent of the input limit. Above that line, it did not ask for a compaction at a sensible size; it set the SDK's reserved headroom to the whole context window, which leaves a compaction threshold of zero tokens, so the SDK compacted at its next check whatever the provider had reported. The same override cut the part of the history kept verbatim to a sixteenth of the limit, 1,024 tokens for a 16,384 budget.
The byte count was never a token count, and for ordinary English text a token covers several bytes. In the scripted run, the 16,384 budget tripped after the second prompt, with about 19 KB of JSON history and 12,000 reported tokens. #498 removes the override. A configured budget still bounds the SDK's threshold, now in tokens, and a stricter native setting still wins. The SDK decides from the provider's reported usage plus an estimate for later messages, and it falls back to its own estimate of the whole conversation when the provider reports no usage. A context that really exceeds its budget still compacts: the #498 test that reports 100,000 input tokens against a 65,536 budget checks that, and it passes before and after.
The #498 test files show the change from a different side. On v0.1.340, three of their six tests fail: the status report has no field that says where its estimate came from, and the runtime does not translate the SDK's compaction events at all. At the merge all six pass. Their 49 KB fixture did not make the old code compact in that test, which is why the scripted run above uses several medium prompts.
Compaction you can see
The second half of #498 is the part an operator notices. When the SDK starts, finishes, fails or cancels an automatic compaction, Hayate Agent now reports it as activity, as a message in a chat gateway that has progress enabled, as a status line in the terminal UI and as an event in the run API. The gateway text is German, "Kontext wird komprimiert" (context is being compacted), and a failed or cancelled run adds that the original context is kept. The events carry only the state and the reason, never the summary or an error text. They are published as activity, but they create no tool entry, so a compaction does not look like tool work on the task. A new test runs the event translation, checks the activity and the gateway messages, and plants private strings that must not appear in that output; the translated event itself, the terminal UI and the run API are not covered by that privacy check. Gateway progress is off in the default configuration, so an operator has to switch it on to see these messages in a chat.
I would rather have an agent that says it is summarizing than one that is merely quiet for a minute. On the same day, #501's description reports real requests taking 8 to 21 minutes, and it says explicitly that the pull request does not claim to solve serving performance. In that situation, telling a compaction apart from a slow model is the first question an operator has, and until #498 the chat could not answer it.
The rest of Sunday
Most of the day's merges came from the same complaint, which #501 states in one line: Minerva, one of the agents on Hayate Agent, is still slow. #493 shortens the standing context of task workers, keeps long tool output in private retained originals and gives the model compact excerpts with a way to read the exact original. #495 handles a failed SDK compaction by archiving the full evidence and starting a fresh session that points to it, without retrying the summary or replaying work. #496 keeps the end of an oversized worker report, so a report that looks successful at the start can no longer hide a blocked status at its end. #497, merged 51 minutes before #498, stops giving local models smaller default budgets of 16,384 tokens for Main and 8,192 for workers, and keeps both only as explicit operator settings. #501 tells Main, the Dispatcher and workers in their system prompt how to read excerpted and retained tool results, and tells the agents to yield for asynchronous work instead of polling a task whose state has not changed.
Three merges concern scheduled work. #492 holds a scheduled occurrence after three unsuccessful recovery assessments instead of retrying it, and #494 stores a deliberate silent answer as evidence bound to the exact occurrence and turn, without treating it as completion. #499 adds a way to run an existing loop once on demand, deduplicated and without touching its schedule or its remaining count; a paused loop refuses.
What merged and what shipped
All times are Europe/Berlin. In the window from 15 November, 08:00, to 20:00, nine pull requests merged, all in core, from #492 at 09:49 to #501 at 19:24, and nine core releases were published, v0.1.335 at 09:59 to v0.1.343 at 19:33. Each of those tags resolves to the merge commit of one of the nine pull requests; #498 is v0.1.341, published at 14:01. Plugins, webui and deployment-base merged nothing and published no release. Two core pull requests opened in the window were still open when checked, #500 and #502, and neither is covered here. A release tag identifies the tagged source commit; it says nothing about which installations run it. When core was fetched at 20:10, main was at the #501 merge.
Limits
The live measurements, about 49 KB of JSON against 11,000 to 12,000 tokens, and the reports of compaction after a fresh start come from the #498 description, as do its 53 focused tests, the full local run of 2,631 passing tests with one optional skip and the independent review; none of these was rerun for this post. The description also says that the most recently inspected fresh session had no actual compaction, and that it does not claim every reported wait in the UI was one. #498 makes no claim about speed, and #501 names the backend observations separately and does not claim the code fixes serving performance. The scripted run uses one fake provider with a fixed usage number. The status field is still called contextEstimateTokens; it now says whether its value comes from the SDK or from the approximate fallback of bytes divided by three, which is used when the SDK has no usable count. The history size that decides whether maintenance skips a tiny new conversation is still bytes divided by three. Compaction messages appear in a chat only where the gateway's progress output is enabled, which is not the default.
Verdict
A host that compacts on its own byte count does extra model work and throws away context while the provider still reports plenty of room, and nobody watching the chat can see it. #498 takes the trigger away instead of adjusting it, trusts the token numbers the SDK already gets from the provider, and keeps a real overflow as a real reason to compact. Showing each compaction in a chat with progress enabled is the half I value more, because it turns "the agent is slow" into a question an operator can answer. The morning post listed the byte trigger as an open limit, and it was closed before lunch.
Sources used
- Hayate Agent core pull request #498, "fix(context): use SDK token pressure and expose compaction lifecycle", merged 15 November 2026: https://git.vanillacore.net/harness/core/pulls/498
- Core release v0.1.341, the #498 merge: https://git.vanillacore.net/harness/core/releases/tag/v0.1.341
- Core release v0.1.340, the release before #498: https://git.vanillacore.net/harness/core/releases/tag/v0.1.340
- docs/local-working-context.md at the #498 merge: https://git.vanillacore.net/harness/core/src/commit/bd20d44971caa266882741c06fb9315d170dddb7/docs/local-working-context.md
- Core pull request #460, which introduced the byte trigger: https://git.vanillacore.net/harness/core/pulls/460
- Core pull request #467: https://git.vanillacore.net/harness/core/pulls/467
- Core pull requests #492, #493, #494, #495, #496, #497, #499 and #501: https://git.vanillacore.net/harness/core/pulls/492, https://git.vanillacore.net/harness/core/pulls/493, https://git.vanillacore.net/harness/core/pulls/494, https://git.vanillacore.net/harness/core/pulls/495, https://git.vanillacore.net/harness/core/pulls/496, https://git.vanillacore.net/harness/core/pulls/497, https://git.vanillacore.net/harness/core/pulls/499, https://git.vanillacore.net/harness/core/pulls/501
- Core release v0.1.343, the #501 merge: https://git.vanillacore.net/harness/core/releases/tag/v0.1.343
- This morning's post, "Hayate Agent Counted Bytes and Called Them Tokens": https://samaschke.com/Blog/Post/hayate-agent-counted-bytes-and-called-them-tokens
- Hayate Agent on GitHub: https://github.com/hayate-agent