feat(coordination): type ask_human questions and fail closed on automated answers - #719
Merged
Merged
Conversation
…ated answers Agents may now mark a question `clarification` (informational, answerable by an automated responder) or `approval` (credentials, spend, production access or an irreversible external action — a human must own it). The class an agent supplies is a claim, not proof: the gate in `answerHumanQuestion` is what makes the distinction load-bearing, and it fails closed. Anything that is not exactly `clarification` — absent, misspelled or a stale enum value from an older agent — resolves to `approval`, so every caller that predates this field is refused automation. Human surfaces are recognised by an allowlist (dashboard route, `discord:` actor, OpenSwarm's own supervisor), not by a caller-supplied role, so a connector that omits the role or claims `human` is still treated as automated. A refused answer is left unsettled, so a human can still answer it. Verified: src/coordination/humanQuestions.test.ts + coordinationTools.test.ts 48/48 pass, `npm run lint` exit 0, `npm run typecheck` clean. Refs: AGT-4514
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
ask_humangains a typed question class, and the answer side fails closed (AGT-4514).clarification(informational — a fact the asker could not look up) orapproval(credentials, spend, production access, an irreversible external action — a human must own it). Absent meansapproval.answerHumanQuestion: an automated responder may only answer a question that is exactlyclarification.clarification— absent, misspelled, or a stale enum value from an agent written before this field existed — resolves toapproval, so every existing caller is refused automation rather than silently granted it.discord:actor, and OpenSwarm's own supervisor (which answers with the authority the operator delegated). A connector that omits the role, or claimshuman, is still treated as automated.metadata, so the gate can re-read it after the fact.Why it is safe to merge
resume/ledger behaviour: the diff touches only question posting/answering and theask_humantool's input surface.approvalquestion from each allowlisted surface.Verification
Includes explicit fail-closed cases: no class ⇒ refused, omitted/
human-claiming automated role ⇒ refused,clarification⇒ allowed, refused answer remains answerable by a human.Refs: AGT-4514