run_graph
Composition and CLI entry point for running an agentrelay task graph.
Usage::
python -m agentrelay.run_graph graphs/demo.yaml
python -m agentrelay.run_graph graphs/demo.yaml --dry-run
python -m agentrelay.run_graph graphs/demo.yaml --max-concurrency 4 --model claude-opus-4-6
This module provides:
run_graph(): async composition function that wires all components and runs the orchestrator.dry_run(): validates a graph YAML and prints the execution plan.main(): CLI entry point with argparse.
OperationalConfig
dataclass
Graph-level operational settings extracted from YAML.
These keys are popped from the raw YAML dict before graph parsing
(which rejects unknown keys). None means "not specified in YAML;
fall back to CLI or default."
Source code in src/agentrelay/run_graph.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
RunOptions
dataclass
CLI-level options for run_graph().
Bundles the keyword arguments that callers pass to control
orchestration behavior. None for optional fields means
"not specified; fall back to graph YAML, then
OrchestratorConfig default."
Attributes:
| Name | Type | Description |
|---|---|---|
tmux_session |
Optional[str]
|
Override tmux session name, or |
keep_panes |
bool
|
Keep tmux panes open after task completion. |
model_override |
Optional[str]
|
Override model for all agents. |
max_concurrency |
Optional[int]
|
Maximum concurrent tasks. |
max_task_attempts |
Optional[int]
|
Maximum attempts per task. |
teardown_mode |
Optional[str]
|
When to tear down task resources
( |
fail_fast_on_workstream_error |
Optional[bool]
|
Stop on workstream failure. |
fail_fast_on_internal_error |
Optional[bool]
|
Stop on internal errors. |
credential_provider |
Optional[CredentialProvider]
|
Credential provider for sandboxed agents. |
anthropic_credential_name |
Optional[str]
|
Anthropic credential name from the credentials YAML. |
sandbox_override |
Optional[str]
|
Override sandbox type for all tasks
( |
verbose |
bool
|
Show detailed step-level output. |
Source code in src/agentrelay/run_graph.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
run_graph(graph_path, repo_path, *, options=RunOptions())
async
Build all components from a graph YAML and run the orchestrator.
This is the top-level composition function that wires
:func:build_standard_runner, :func:build_standard_workstream_runner,
and :class:Orchestrator together.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_path
|
Path
|
Path to the graph YAML file. |
required |
repo_path
|
Path
|
Path to the repository root. |
required |
options
|
RunOptions
|
CLI-level run options controlling orchestration behavior. |
RunOptions()
|
Returns:
| Name | Type | Description |
|---|---|---|
OrchestratorResult |
OrchestratorResult
|
Terminal orchestration result. |
Source code in src/agentrelay/run_graph.py
802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | |
dry_run(graph_path)
Validate a graph YAML and print the execution plan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph_path
|
Path
|
Path to the graph YAML file. |
required |
Source code in src/agentrelay/run_graph.py
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | |
main()
CLI entry point for running an agentrelay task graph.
Source code in src/agentrelay/run_graph.py
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 | |