Repository navigation
factory: AgentField run_on fixes from the live trigger test - #2533
Merged
Merged
Conversation
…ever an agent, waiting jobs route at once A rule that routes a job withdraws the inbox's 'waiting for a repository' line; a rule or an agentfield step on this organization's own node is refused when saved and left out of factory.agentfield_reasoners; saving the routing table and turning the runner on each run one routing pass.
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.
Fixes from the live AgentField trigger test of b726d4b (
~/factory-e2e/af-triggers-live/SUMMARY.md). Three bugs are fixed. Bug 4 is documented, not changed. Bug 5 is not local to the engine.1. A run_on job logged "waiting for a repository" — fixed
The inbox files the job and writes the waiting line before the routing table is read. Routing (
intake.applyRoute) now removes that line (withdrawWaiting) once a rule gives the job a repository or a reasoner. Other activity rows are kept. A job filed withrun_onalready skipped the line.Test:
TestARuleThatRunsOnAReasonerWithdrawsTheWaitingLine.2. A rule or step could run on this organization's own node — fixed
routeReasonersKnown(factory.routes_set) refusesrun_onon the own node. The message reads:routing rule "<name>": that agent is this organization itself; pick another.factory.pipeline_copy_setandfactory.pipeline_prrefuse anagentfieldstep on the own node. The message reads:step "<name>": that agent is this organization itself; pick another. This check runs only on this machine's factory, which is the one that knows its node id. Node ids are compared without regard to case.factory.agentfield_reasonersno longer lists the own node, so no picker offers it.Test:
TestTheOrganizationsOwnNodeIsNeverAnAgentToRunOn.3. Waiting jobs were not routed when the runner started or the rules changed — fixed
appFactoryHost.routeSoonruns one intake pass in the background as a host chore. Close waits for it, and the store's intake lock stops it from overlapping another pass. It runs:startLocalRunner, which coversfactory.local_runand its automatic start);factory.routes_setsaves on this machine's factory.Locks are released with
defer.routeNowhad no callers before this change; it is used now.Test:
TestWaitingJobsAreRoutedWhenTheTableIsSavedAndWhenTheRunnerStarts. It uses a poll source that never arrives, which is the no-watched-repo case. The test fails withrouteSoondisabled and passes with it.4.
factory.local_runneeds GitHub — NOT changedThis refusal comes from identity, not from publishing. The runner is a worker that attaches to the factory.
serve.attachWorkerrefuses a worker with no handle:worker attach requires name and handle. On loopback it fills the handle fromseam.PersonHandle, which is the GitHub login. That handle is used as:factoryIntakeOwned);FactoryLocalRunreads/v1/mefirst and refuses early, so the runner does not retry silently forever.Starting without GitHub would take two things:
That touches the worker and identity model, so it is out of scope for a fix lane. The manual now says plainly that the runner still needs GitHub, and that AgentField entries are filed while the runner is off and routed once it is on.
5. A furrow helper outlived shutdown — not fixed, cause not in the engine
Every furrow call the engine makes is a short-lived
exec.CommandContextwithWaitDelay(internal/furrow/furrow.go:540). The attach runswatch --no-daemon, and the engine starts no long-lived furrow child. A furrow with ppid 1 that survives the engine is a process furrow detached itself, for example a sealer or daemon started by one of its subcommands. The engine has no handle on that process. The evidence does not record its command line. Next step: captureps -o pid,ppid,commandfor the leftover process on the next live run, then file the issue in furrow or fix the flag that leaves it running.Manual
internal/manual/chat/factory-agentfield.mdchanges:One probe was added to
internal/manual/chat_test.go.Proof
make pr-ready BASE=origin/factory/general-intakeexited 0.TestMemoryPausedJobLifecycle/stop_tailfailed once on a timing check (memory accounting differs) and passed on its retry. The classifier marked it flaky. It also passed-count=2focused. The new runner-start pass returns at once in that test, because it has no rules.🤖 Generated with Claude Code