agentos-project/agentos

`WebRegistry._request_spec_from_web_server()` drops attributes with value of `False`

Closed this issue · 0 comments

andyk commented

See line 624 here:

agentos/agentos/registry.py

Lines 621 to 630 in c59e476

for spec_key, spec_val in [
(k, v)
for k, v in flat_spec.items()
if k.endswith("_link") or not v
]:
logger.debug(
f"Dropping field '{spec_key}: {spec_val}' from spec "
"returned by web server."
)
flat_spec.pop(spec_key)

...this should not drop attributes that have a value that is False.

When I wrote this, I was thinking that attributes that are False would be optional (and that may have been the case at the time), but that isn't true any more.

E.g., today we're adding the boolean log_return_value attribute to the RunCommand spec which does not have a default value.

It should be safe to just remove or not v part of that conditional check and include all attributes in the returned spec, even ones that are False. Or alternatively, we could change it to or v is None to omit only attributes whose values are None.