Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/serve_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def main(args: Args) -> None:
local_ip = socket.gethostbyname(hostname)
logging.info("Creating server (host: %s, ip: %s)", hostname, local_ip)

policy_metadata["config"] = args.policy.config
policy_metadata["directory"] = args.policy.dir
Comment on lines +111 to +112

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard metadata enrichment for default policy

When the server is started without an explicit checkpoint (the default CLI path where args.policy is Default()), the new metadata assignments access args.policy.config and .dir, but the Default dataclass has no such attributes. This now raises an AttributeError before the websocket server is created, breaking the default-serving flow; only checkpoint-based invocations work. Consider populating these fields only when the policy is a Checkpoint.

Useful? React with 👍 / 👎.


server = websocket_policy_server.WebsocketPolicyServer(
policy=policy,
host="0.0.0.0",
Expand Down
Loading