Make the app-server thread unload delay configurable (#42320)

## What changed

- Add the top-level `thread_unload_delay_secs` configuration key for the
  app-server, with a 60-second default instead of the previous 30-minute
  fixed delay.
- Allow zero-delay unloading and reject values that cannot fit in a
  monotonic-clock deadline.
- Reset the unload countdown when a thread gains a subscriber or becomes
  active, and preserve active turns even when the configured delay is zero.
- Document that unloading ephemeral threads discards their in-memory state.

## Testing

- Cover configuration parsing, defaults, overrides, and overflow rejection.
- Cover unsubscribe, resubscribe, delayed and immediate unloading,
  notifications, persisted-thread resume, and WebSocket disconnect behavior.

GitOrigin-RevId: edd46f6b49bbdafbf606bff74378e8f569e95977
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-02 18:18:54 +00:00
1 parent a526f54b00
commit 5e26f7621c
11 files changed
+238 -13

No files matched your search

+6
View File
@@ -6771,6 +6771,12 @@
"description": "Suppress warnings about unstable (under development) features.",
"type": "boolean"
},
"thread_unload_delay_secs": {
"description": "Seconds a thread must have no subscribers and no activity before app-server unloads it. Defaults to 60; zero unloads immediately. Changes require a server restart.",
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"tool_output_token_limit": {
"description": "Token budget applied when storing tool/function outputs in the context manager.",
"format": "uint",