Repository navigation
factory: AgentField triggers from the app, and routing rules that run on a reasoner - #2525
Merged
santoshkumarradha merged 5 commits intoNov 9, 2026
Merged
Conversation
…e can run a job on a reasoner factory.agentfield_triggers now carries the source catalog (labels, config fields) and each trigger's entry source, webhook address and creation time. factory.agentfield_add_trigger makes a trigger aimed at the node's intake and says what to set up; a source the catalog lacks or a missing secret variable is refused in words, and no refusal quotes the config. Feature factory.agentfield_triggers. A routing rule's then may name run_on (node.reasoner): a matched job runs on that reasoner with no repository, as a job filed with run_on does. The reasoner is checked against the control plane when the rules are saved on this machine's factory. when.sources agentfield:* matches every AgentField source. Feature factory.route_run_on.
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.
What this changes
Triggers from the app.
factory.agentfield_triggers {factory}now returns the control plane's source catalog alongside this node's triggers, and the newfactory.agentfield_add_triggercreates a trigger aimed at<node>.intake. Feature flag:factory.agentfield_triggers.Routing to a reasoner. A routing rule's
then.run_on: "<node>.<reasoner>"sets the job'sRunOn. The job then needs no repository, gets no pipeline steps, and runs like any existing run_on job. Feature flag:factory.route_run_on.route.Cleanchecks the spelling withfactory.AgentFieldTargetWord, the same check pipeline AgentField steps use, and refusesrun_oncombined withpipeline.factory.routes_setalso checks each reasoner against the control plane's node list. An unknown one is refused withrouting rule "<name>": AgentField has no agent <x>; pick one it lists. A factory that isn't connected answersconflict. A team server's rules are checked for spelling only.run_onjob is decided underpipeline.Defaults()instead of reading a repository's file.when.sources: [agentfield:*]now matches everyagentfield:<source>job (a trailing*after:or/). There is a test for it.Redaction. No wire-log redaction list exists, in this repo or in codeaf-desk. What
agentfield_connectdoes is mask its strict-decode error so the input is never quoted. Both trigger adds (_add_triggerand the older_trigger_add) now do the same, and the engine never logs a config. A test asserts a malformed add doesn't quote its input.Manual.
factory-agentfield.mdrewrites "add a trigger" (it can be done from the app; the secret lives in the control plane's env var) and adds "send jobs to an AgentField reasoner with a routing rule".factory.mdrouting rules listrun_onandagentfield:*. Two probes were added.PROTOCOL.mddocuments both features.Contract
Everything the desk lanes code against is there with the exact names. These are additive or worth knowing:
factory.agentfield_triggersalso keeps its existingnode_id, and each trigger keeps its existing fields (reasoner,ingest_url,managed_by,secret_env_var,events_24h,failed_24h,last_event_at).webhook_urlequalsingest_urland is absent for aloopsource (cron).labelis the source's label.sources[]also carriessecret_requiredandconfig_schema.sources[].event_types?(the factory lead's addition) is passed through from/api/v1/sourceswhen the control plane lists it, trimmed and de-duplicated, and left out otherwise. Today's AgentField catalog does not send it, so it is absent against current control planes.config_fields[].secretis true when the schema sayswriteOnlyorformat: password, or when the field name contains a word like secret, token, password or key.factory.agentfield_add_triggertakes an additional optionalsecret_env_var. AgentField refuses a secret-requiring source (linear, generic_bearer, generic_hmac…) without one, so the engine refuses first, in words:<Label> needs a signing secret: name the control plane's environment variable that holds it (secret_env_var).setup.secretis never filled. AgentField reads secrets from its own environment and never returns one.setupadditionally carriessecret_env_var.setupis absent when there's nothing to set up (a cron trigger).conflict:this organization is not connected to AgentField; connect it first.factory.agentfield_sources/factory.agentfield_trigger_addstay as they were, as the older pair.Refusal wording. Every refusal this PR adds says "agent", not "reasoner", because the desk shows refusals word for word. This covers the save-time check, the
run_onspelling (then run_on names an AgentField agent as node.agent: …) and the no-pipeline refusal. "reasoner" stays in code, wire field names and comments.Proof
make pr-ready BASE=origin/factory/general-intake, tail:The two
cmd/codeaftests that failed in shard runs passed on their re-run, so the classifier marked them flaky. Neither touches this code. An earlier run flaggedTestMemoryPausedJobLifecycle/stop_tailthe same way.🤖 Generated with Claude Code