Repository navigation
Bind Sessions through Runtime assignments and delete prompt_request - #479
Merged
Merged
Conversation
Every Session frame between Core and a Runtime carries an assignment reference. Core binds the Session before its first operation, records a release intent with each deletion, Environment release and archive, and reconciles pending releases after a reconnect. The Runtime fences stale, foreign and mismatched frames and settles a Session's work before it acknowledges a release. prompt_request had no producer and is deleted.
Release settles a Session's non-Executor work before it replies; cached interaction receipts and Resume answer only their own assignment. Core checks each reply's assignment in the common exchange and subscriptions, accepts assignment rejections in workspace receipts, settles releases no Runtime can act on, and backs off failing releases.
Cover the release fence on an unfinished workspace write, make the integration Runtime fakes echo the assignment of each request and Run, and document echoed assignments, release fencing, settlement without authority and release backoff.
SaladDay
force-pushed
the
aos/cutover-assignments
branch
from
October 7, 2026 12:08
2c883e9 to
4fa91ee
Compare
Contributor
|
Found 1 test failure on Blacksmith runners: Failure
|
…them fairly A release now waits for every read, write, export and Runtime preparation of its Session until that work has sent its terminal result, counted on the assignment, and a canceled export still answers the request Core awaits on its own send budget. Revocation and release creation take the device row lock before either reads the other's state, so a release racing a revocation of its shared Runtime is settled. Due releases run longest-due first, so releases that keep failing cannot starve the rest.
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.
Every Runtime, including today's in-sandbox daemon, now works through Runtime assignments, and
prompt_requestis deleted. Placement does not change.Wire (
internal/agentdaemon/proto, version stays 0.12.0)AssignmentRefand theassignment_bind,assignment_release,assignment_statusandprotocol_errormessages. Every Session frame carries the reference, and replies echo it. The heartbeat declareshome_removal.ValidRuntimePrepareResultacceptsassignment_staleandassignment_conflict.prompt_requestis deleted from Core, the proto, the daemon Router (dispatch/prompt.go,dispatch/output.go) anddocs/runtime-protocol.md(+zh).Daemon (
apps/daemon/internal/dispatch)unsupported_operation.protocol_error.Core
session_devicestosession_runtime_assignments(device_id→runtime_id) and addsassignment_id,epoch,desired_state,remove_homeandapplied_epoch, with a down migration. Every reader and writer moved in this PR.applied_epochonly after a matching acknowledgement.Acceptance tests
TestAssignmentRejectsStaleAndForeignFramesTestAssignmentReleaseWaitsForRacingPreparationTestDeletionReleaseReachesReconnectedRuntimeTestReleaseWithoutHomeRemovalKeepsAssignmentTestReleaseRemovesTheHomeTestUnknownEnvelopeGetsCorrelatedProtocolErrorChecks:
go testoninternal/agentdaemon/..., everyapps/daemonpackage and Core'sruntimegateway,execution,sessions/...,persistence/...andcmd/.... The full Core integration suite passes. New concurrent tests ran with-race -count=50. Alsogo vet,gofmt, the darwin and windows builds ofapps/daemon, andmake check-names check-docs check-ci.Follow-ups, outside this PR
prompt_requestgone,Registry.Resolve,RegisterKind'sagent.FactoryandRuntime.Sessionhave no caller. Removing them is a Runtime–Harness protocol change.home_removalheartbeat and Router wiring land in PR5.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.