@@ -135,11 +135,14 @@ def _bundle_declared_runtimes() -> set[str]:
135135 capabilities = manifest .get ("capabilities" , [])
136136 if not isinstance (capabilities , list ):
137137 return set ()
138- return {
139- capability .get ("runtime" )
140- for capability in capabilities
141- if isinstance (capability , dict ) and isinstance (capability .get ("runtime" ), str )
142- }
138+ declared : set [str ] = set ()
139+ for capability in capabilities :
140+ if not isinstance (capability , dict ):
141+ continue
142+ runtime = capability .get ("runtime" , "opentabs" )
143+ if isinstance (runtime , str ):
144+ declared .add (runtime )
145+ return declared
143146
144147
145148def _available_agent_runtimes () -> list [str ]:
@@ -150,8 +153,28 @@ def _available_agent_runtimes() -> list[str]:
150153 return runtimes
151154
152155
153- _EDGE_RUNTIME_CONFIG_KEYS = frozenset (
154- {"binary" , "args" , "env" , "cwd" , "project_root" , "provider_dir" , "usage_file" }
156+ _EDGE_RUNTIME_TASK_CONFIG_KEYS = frozenset (
157+ {
158+ "action" ,
159+ "agent_id" ,
160+ "base_delay" ,
161+ "breaker_threshold" ,
162+ "chrome" ,
163+ "input_wait_seconds" ,
164+ "local" ,
165+ "max_attempts" ,
166+ "model" ,
167+ "pack" ,
168+ "permission_mode" ,
169+ "plugin" ,
170+ "poll_interval" ,
171+ "provider" ,
172+ "response_timeout_seconds" ,
173+ "settle_seconds" ,
174+ "suggested_wait_seconds" ,
175+ "tab_id" ,
176+ "timeout_seconds" ,
177+ }
155178)
156179
157180
@@ -525,14 +548,19 @@ async def _register_via_ws(advertise_url: str) -> None:
525548 _proxy = _HTTPS_PROXY or _HTTP_PROXY or None
526549 # Computed once (not per reconnect attempt): runtime availability includes
527550 # fixed-binary compatibility probes and does not change without a restart.
551+ runtimes = _available_agent_runtimes ()
552+ runtime_capabilities = available_runtime_capabilities ()
553+ for runtime in runtimes :
554+ runtime_capabilities .setdefault (runtime , [])
528555 register_payload = json .dumps (
529556 {
530557 "type" : "register" ,
531558 "agent_url" : advertise_url ,
532559 "mode" : _AGENT_MODE ,
533560 "node_type" : _AGENT_DEPLOY_TYPE ,
534561 "label" : _AGENT_LABEL ,
535- "runtimes" : _available_agent_runtimes (),
562+ "runtimes" : runtimes ,
563+ "runtime_capabilities" : runtime_capabilities ,
536564 "profile_kind" : _BROWSER_PROFILE_KIND ,
537565 }
538566 )
@@ -687,7 +715,7 @@ async def invoke_runtime_http(
687715 status_code = 403 ,
688716 detail = f"runtime { req .runtime !r} is not declared by the installed bundle" ,
689717 )
690- unsafe_keys = sorted (_EDGE_RUNTIME_CONFIG_KEYS . intersection (req .config ))
718+ unsafe_keys = sorted (set (req .config ) - _EDGE_RUNTIME_TASK_CONFIG_KEYS )
691719 if unsafe_keys :
692720 raise HTTPException (
693721 status_code = 400 ,
0 commit comments