Repository navigation
Conversation
3f08373 to
09b6b04
Compare
|
After checking current code, documentation and open PRs, much of the broader collaboration idea already has an implementation or an existing owner. This PR should remain focused on truly sequential ordinary delegation while the parent waits, rather than introduce another swarm runtime. Existing work to build on:
The broader use case includes local models, shared inference servers, hosted APIs and teams using different models, with different concurrency, memory, rate and cost limits. The terminology comes from Towards a Science of Scaling Agent Systems (architectural comparison in Table 2 of v1). It is useful to separate two choices:
Two useful phased schedules, already expressible with Kanban dependency graphs:
The scheduler should distinguish concurrent agent lifetimes, tool execution and model requests. A worker waiting on a build or web request may leave useful room for another worker. A shared model endpoint may benefit from serialized requests and prompt reuse; separate endpoints or a batching-capable server may benefit from concurrent requests. Hosted APIs add rate and cost budgets. These should be configurable capabilities and limits, rather than assumptions tied to a particular machine or provider. The paper evaluates multiple agent architectures and finds task-dependent benefits and coordination costs. It motivates comparing approaches; it does not establish that Hybrid MAS or more agents will always be faster or more reliable, nor does it validate either phased scheduling policy proposed here. For a Hybrid MAS experiment, the existing messaging and worker PRs above are the appropriate starting points. Desirable constraints are explicit recipients, compact findings/artifact references, clear queued-versus-delivered status, message/round limits, and an orchestrator that resolves conflicts and owns final verification. Peer messages should retain their sender identity rather than being treated as user instructions. Workers need explicit artifact ownership and bounded dependency waits. Peer communication does not require all agents to generate simultaneously. A shared Kanban blackboard is useful coordination, but should not automatically be labelled the paper's directed peer-message topology. I would reuse and document these existing mechanisms before proposing any new scheduler or peer tool. This PR is not an adaptive scheduler or peer-messaging implementation. Our earlier bounded experiments only varied scheduling in Centralized MAS. Evaluation should compare a single-agent baseline, Centralized MAS and Hybrid MAS on the same tasks and budgets, across representative backends. Useful outcomes are independently verified success, completion time including failures/retries, tokens and API cost, prompt reuse, tool/model overlap, peak memory and clean cancellation. That would show when collaboration helps instead of assuming one topology or schedule is best for every Hermes user. |
09b6b04 to
f0ea7b5
Compare
f0ea7b5 to
4fbef6e
Compare
4fbef6e to
2587d82
Compare
|
Static execution-policy review: the sequential mode keeps model-facing schema and runtime behavior on the same frozen decision, which is the important invariant here. I checked the A→B→A/profile-change case in particular:
That is a good pattern for policy-bearing agent tools: snapshot once per runtime and make the schema/cache key carry the same policy. No blocker found in this pass; I did not execute the suite here. |
Merge current main into the sequential-delegation branch. Keep resolved disabled toolsets and agent-specific filtering while freezing the schema and dispatch policy together for each parent session. Add loader/profile regressions for default-off behavior, A/B/A isolation, existing versus fresh sessions, and exception cleanup. Extract the small schema-loading and pure-default blocks to preserve repository size limits. Validation: 19 selected canonical tests passed without failures, skips or retries; all 12 repository checks passed. Child execution is doubled; no live-model or performance claim is made.
|
Updated the branch against current main while preserving the existing sequential-delegation behavior and the newer session toolset exclusions. The session still captures its delegation policy once; schema construction and dispatch use that same snapshot. The merge also keeps agent-specific tool drops and one-shot pruning in their current order. I moved the small schema-loading block and delegation defaults into existing/new sibling helpers to satisfy the repository's file-size checks. Validation on Windows: 19 selected tests passed with no failures, skips or retries, including the original sequential-dispatch tests, the new merge regressions, and existing config load/save checks. All 12 repository checks passed. These are scoped native-code and fixture checks; this update does not claim a live-model or performance result. |
What does this PR do?
Adds opt-in
delegation.sequential: truefor workflows that need one delegated child to finish before another starts, with the parent waiting for the completed batch. This can be useful when sharing a constrained inference endpoint, controlling overlapping requests to a hosted provider, or intentionally serializing delegated work. It works as a Hermes execution policy and does not depend on a specific model, backend or hardware configuration. Normal background delegation stays the default.Limiting
max_concurrent_childrento 1 does not make a background call synchronous: the parent can still issue model requests while its child runs. This option overrides background dispatch at the common batch entry point, suppresses independent completion delivery, and advertises the actual behavior in the tool description. The existing maximum still bounds the number of tasks accepted in a call.The policy is profile-scoped. It is not a global lock across sessions/processes, an API rate limiter, or a dependency scheduler; it does not automatically pass one child's results into the next child's task. It makes no universal throughput claim. Start a new session after changing it to preserve prompt-cache stability.
Related work
Related to #62392, which proposes foreground-by-default delegation and has maintainer feedback about session-stable policy. This PR also forces a multi-child batch to one worker, and snapshots that sequential policy together with the agent's tool definitions. A foreground join alone can still run its children concurrently. These proposals overlap on the parent-waits behavior; consolidating the public configuration surface is a maintainer decision. #122815 separately addresses a wall-clock bound on synchronous joins; this PR does not replace timeout/liveness handling.
Design and overlap review: general collaborative-agent scheduling across local models, hosted APIs and multiple endpoints, using the Centralized MAS / Hybrid MAS terminology from Towards a Science of Scaling Agent Systems. Existing Kanban graphs already express parallel-then-sequential and sequential-then-parallel phases. Existing A2A/Bot paths and open PRs #106423, #123218, #106268 and #98824 cover related messaging/orchestration work. This PR documents those boundaries and does not introduce a duplicate swarm runtime.
Type of Change
Changes Made
delegation.sequentialin defaults and the example config.How to Test
Tested on Windows/Python 3.14.7, rebased onto main
3cf2eb1c94.e85706cba7) and pass with this patch. The subsequentc2f3192929update changes desktop/web code, not the delegation implementation.scripts/run_tests.shrun over the 40test_delegate*.py/test_async_delegation*.pyfiles: 320 passed, 0 failed, 2 platform skips.c2f3192929. The final two upstream commits only change gateway slash-command completion and its tests; after rebasing ontoef2013231d, the sequential regression and gateway completion test files were rerun through the canonical runner and passed.test_tool_defs_cache_key_sees_config_replacement_with_pinned_mtimeon Windows. It also fails with the unchanged upstreammodel_tools.pyrestored: a same-sizecopy2overwrite with pinned mtime leaves the tested file signature unchanged. This unrelated existing case is not fixed or claimed green here.ef2013231d; the final rebase adds only upstream'sweb/vitest.config.tsdevelopment-mode change. Python implementation and test contents are unchanged by that rebase.Checklist