Harness spec 3.2.0 in the CLI: effort levels, reasoning round-trip, no absolute paths
ci / check (push) Waiting to run
ci / check (push) Waiting to run
Levels (models/schema.json levels): provider/effort.ts levelsOf/levelFields/ readLevel — `off` only with thinking_switch and sends enable_thinking false and no effort, `default` for a model that takes no efforts and sends nothing, a level not offered is read as the start level. The engine's effort is a level; /effort shows nothing for one level, a Thinking switch for [off, X], a list otherwise; the status bar follows. /v1/models' thinking_switch, efforts [] and capacity.parallel are read (lembas/webui.ts); session/capacity.ts counts parallel slots. Reasoning (context.md §8): an assistant message of the current turn carries reasoning_content (provider/common.ts turnReasoning, openai-chat.ts); step-boundary deliveries, nudges and the wrap-up are marked turn: false and do not start a turn. Paths (context.md §11): the <env> block names the project and, started below the root, that directory relative to it (assemble.ts envLines); instruction files and @ attachments are named from the root or as ~/…; file tools and bash resolve relative paths against the project root. The team rules (team/team.ts) and conformance runners for levels, reasoning, paths and team; the team runtime follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
36 files changed
+1168
-153
No files matched your search
+22
-6
@@ -1,7 +1,8 @@
|
||||
// Whether a subagent may run on a model beside the session's own, judged by what its server can do
|
||||
// at once — the harness spec's capacity rule, after LLeMbas services/helpers.py (© Jaroslav Beneš,
|
||||
// MIT). Both flags name the restrictive state and default off, so a configuration that
|
||||
// never sets them works exactly as before.
|
||||
// never sets them works exactly as before. From spec 3.2.0 a model says how many requests it serves
|
||||
// at once (`parallel`; single_session is 1).
|
||||
//
|
||||
// - A connection that holds one model at a time (llama-swap in front of one GPU): a subagent on
|
||||
// another of its models unloads the session's model, and the session's cached prompt with it,
|
||||
@@ -11,10 +12,23 @@
|
||||
// minutes, on a long session with a small GPU.
|
||||
import type { ResolvedModel } from "../provider/types.ts"
|
||||
|
||||
export function capacityRefusal(main: ResolvedModel, helper: ResolvedModel): string {
|
||||
/** How many requests a model's server serves at once (models/schema.json capacity, spec 3.2.0):
|
||||
* `parallel` when given, else 1 for single_session, else no limit (a hosted API). */
|
||||
export function parallelOf(m: Pick<ResolvedModel, "spec">): number {
|
||||
const p = m.spec.parallel
|
||||
if (Number.isInteger(p) && p! >= 1) return p!
|
||||
return m.spec.single_session ? 1 : Infinity
|
||||
}
|
||||
|
||||
/** `busy`: this session's requests the helper's model already serves besides the main prompt's
|
||||
* (subagents running on it). */
|
||||
export function capacityRefusal(main: ResolvedModel, helper: ResolvedModel, busy = 0): string {
|
||||
if (helper.ref === main.ref) {
|
||||
if (helper.spec.single_session)
|
||||
return `${helper.ref} serves one request at a time (single_session), so it cannot be its own subagent: the subagent would take the server's only slot and push this session's cached prompt out of it.`
|
||||
const n = parallelOf(helper)
|
||||
if (n === 1)
|
||||
return `${helper.ref} serves one request at a time, so it cannot be its own subagent: the subagent would take the server's only slot and push this session's cached prompt out of it.`
|
||||
if (1 + busy >= n)
|
||||
return `${helper.ref} serves ${n} requests at once, and this session already has ${n} on it; another subagent would wait, or push this session's cached prompt out.`
|
||||
return ""
|
||||
}
|
||||
const shared = groupOf(main)
|
||||
@@ -28,9 +42,11 @@ export function capacityRefusal(main: ResolvedModel, helper: ResolvedModel): str
|
||||
/** The same rule between two subagents: a new one is not started where its model would unload, or
|
||||
* take the only slot of, a subagent already running (the spec's "beside the model of a subagent
|
||||
* already running"). */
|
||||
export function capacityBeside(running: ResolvedModel, helper: ResolvedModel): string {
|
||||
export function capacityBeside(running: ResolvedModel, helper: ResolvedModel, busy = 1): string {
|
||||
if (helper.ref === running.ref) {
|
||||
if (helper.spec.single_session) return `${helper.ref} serves one request at a time (single_session), and a subagent is already running on it; a second would wait for the first, or push it out.`
|
||||
const n = parallelOf(helper)
|
||||
if (n === 1) return `${helper.ref} serves one request at a time, and a subagent is already running on it; a second would wait for the first, or push it out.`
|
||||
if (busy >= n) return `${helper.ref} serves ${n} requests at once, and as many subagents already run on it; another would wait, or push one out.`
|
||||
return ""
|
||||
}
|
||||
const shared = groupOf(running)
|
||||
|
||||
Reference in new issue
Block a user