Repository navigation
feat(placement): shared native placement policy and peer load evidence - #67
Merged
nullStack65 merged 1 commit intoNov 18, 2026
Merged
Conversation
First layer of native thread placement on release/native-0.1.10. No behaviour changes for any existing launch path. - Move chooseLoadBalancedEnvironment (15 s freshness, 95% CPU, 5% available RAM) unchanged from client-runtime to @t3tools/shared so the server and clients use one selector; client-runtime/load-balancing re-exports it, so web is unchanged. - Add chooseThreadPlacement, a pure decision over evidence the deciding server gathered: a named target wins, work that needs local state stays here (a conflicting target fails), and independent work goes to the operable environment with the project and requested model that has the most fresh headroom. Ambiguous evidence and no eligible host fail explicitly. - orchestrator_capabilities now reports this machine's hostResources, an optional field, so a server can read a linked environment's load through the existing peer link. Older peers omit it and are never chosen. Automatic remote placement is not enabled: it first needs the chosen destination bound durably to the caller's request before any remote effect, so a retry after an uncertain launch reuses it. Task: CLO-866 Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
RESULTRESULT (CLO-866, placement layer 1 of the minimal stack)
Scope:
Merge path: SHA-guarded squash at |
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Universal placement of NEW threads (CLO-866) needs one admission decision that every creation path reaches. On native 0.1.10 the pieces are scattered:
client-runtime, and only web/desktop automatic drafts use it.create_threads/delegate_task/t3_thread_launch, CLI or schedules make an automatic choice, and a server has no load evidence for linked environments.environmentIdalready routes throughPeerForwarding/RemoteDelegation, but nothing binds an automatic choice before the remote effect. RemoteDelegation records the task only after the remote launch, the documented crash window.This PR: foundation layer, no behaviour change
chooseLoadBalancedEnvironmentmoves unchanged to@t3tools/shared/loadBalancing.@t3tools/client-runtime/load-balancingre-exports it, so web and desktop automatic drafts are untouched.@t3tools/shared/threadPlacementchooseThreadPlacement, a pure function with no transport effects. It's PR feat(server): add scoped founder inbox and fleet admission gates #58's policy reimplemented for native; feat(server): add scoped founder inbox and fleet admission gates #58 is not merged.conflicting-locality.ambiguous-environment; no fresh unsaturated host isno-eligible-environment.orchestrator_capabilitiesreports this machine'shostResourcesas an optional field, read from the existingHostResourcesservice. A server reads a linked environment's load over the existing peer link. Older peers omit the field and are never chosen.Not in this PR (next layers, same owner)
clientRequestId, before the remote launch. Retries, lost replies and restarts then reuse that destination and never re-decide. That needs a new orchestration event and receipt-backed replay, so it isn't faked here.delegate_task→create_threads→t3_thread_launchthrough RemoteDelegation's existing follow/recovery. Then web/desktop/mobile, CLI, fresh-thread schedules and Tots move onto this shared policy.Verification (local ASUS, no paid calls)
toSorted, which is fixed.threadPlacement.test.ts(5 cases); the moved selector's existing tests;OrchestratorMcpService.test.ts, whose capabilities case now assertshostResources;RemoteDelegation;PeerForwarding; contracts.Task: CLO-866
🤖 Generated with Claude Code