Make the thread admission cap boot-tunable

efe115790d02 · AtlantisPleb · · parent e416fe7e8da5

Make the thread admission cap boot-tunable

OPENAGENTS_MAX_OPEN_THREADS overrides maximum_open_threads_per_account
at boot in runtime.exs. The THREAD-001 cap mechanism — counted under
the owner lock, refused with thread_quota_reached — is unchanged; the
default stays 8. Fleet-scale delegation testing needs more than four
concurrent coder sessions, and each session holds two threads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GoYpb8FEmdxVErsv7ABCYi
Co-Authored-By
Claude Fable 5 <noreply@anthropic.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

pushed
by user · WAL seq 329 · 2026-08-25T02:41:12.649461Z

Changed files

  • modified config/config.exs
  • modified config/runtime.exs

Diff

2 files changed, +12 -0

config/config.exs modified +2

@@ -355,6 +355,8 @@ config :openagents,

355 355
  # is a person working several checkouts at once, and THREAD-001 admits at
356 356
  # most one live grant per open thread, so the account's concurrent
357 357
  # thread-scoped authority is bounded by eight of the ceilings below.
358
  # `OPENAGENTS_MAX_OPEN_THREADS` overrides the number at boot (runtime.exs)
359
  # without changing the cap mechanism.
358 360
  maximum_open_threads_per_account: 8,
359 361
  # Unbounded, all three. A coding session reached 256 calls, a million tokens,
360 362
  # and two dollars in an afternoon, and was told to start a new session — the
config/runtime.exs modified +10

@@ -117,6 +117,16 @@ config :openagents,

117 117
         buyer: capacity_buyer
118 118
       )
119 119
120
# The thread admission cap from config.exs, tunable per deployment. The cap
121
# mechanism (THREAD-001: counted under the owner lock, refused with
122
# `thread_quota_reached`) is unchanged; this only sets the number, for
123
# fleet-scale testing and deployments whose concurrency profile differs from
124
# the default. Unset means the config.exs default.
125
if maximum_open_threads = System.get_env("OPENAGENTS_MAX_OPEN_THREADS") do
126
  config :openagents,
127
    maximum_open_threads_per_account: String.to_integer(maximum_open_threads)
128
end
129
120 130
continual_learning_config = Application.get_env(:openagents, OpenAgents.ContinualLearning, [])
121 131
122 132
# The admitted base models are a JSON object of model reference to exact model

This page updates live while a promote is in flight · changelog