Skip to content

feat: improve client simulator CLI options#320

Merged
from2001 merged 1 commit intodevelopfrom
claude/issue-319-20260128-1359
Jan 28, 2026
Merged

feat: improve client simulator CLI options#320
from2001 merged 1 commit intodevelopfrom
claude/issue-319-20260128-1359

Conversation

@from2001
Copy link
Collaborator

Summary

  • Remove --enable-recv option and make receiving default behavior
  • Change server address format from tcp://localhost to localhost (accept old format)
  • Add --transform-send-rate option to control transform update frequency in Hz

Closes #319

🤖 Generated with Claude Code

- Remove --enable-recv option and make receiving default behavior
- Change server address format from tcp://localhost to localhost (accept old format for backward compatibility)
- Add --transform-send-rate option to control transform update frequency in Hz

Co-authored-by: Masahiro Yamaguchi <from2001@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the client simulator CLI by making receiving behavior the default, simplifying server address format, and adding configurable transform update rates. The changes align with the requirements in issue #319.

Changes:

  • Changed enable_receive parameter default from False to True in both SimulatedClient and ClientSimulator classes, making broadcast reception the default behavior
  • Removed --enable-recv CLI option and hardcoded enable_receive=True in the simulator initialization
  • Changed default server address format from tcp://localhost to localhost with automatic normalization to add the tcp:// prefix when needed
  • Added --transform-send-rate CLI option (default 10.0 Hz) to control transform update frequency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1909 to +1912
"--transform-send-rate",
type=float,
default=10.0,
help="Transform update send rate in Hz (default: 10.0)",
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The transform_send_rate parameter lacks input validation. If a user provides zero or a negative value, this will cause a division by zero error or produce a negative interval at line 1023 where update_interval = 1.0 / self.transform_send_rate is calculated. Consider adding validation to ensure transform_send_rate is positive (e.g., > 0) when parsing the argument.

Copilot uses AI. Check for mistakes.
Comment on lines +1918 to +1919
if not args.server.startswith("tcp://") and not args.server.startswith("ipc://"):
args.server = f"tcp://{args.server}"
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The server address normalization logic doesn't handle addresses that contain a port number. For example, if a user provides "localhost:5555", this will be transformed to "tcp://localhost:5555", which may not be the intended behavior if the port is meant to override the --dealer-port argument. Consider clarifying the expected behavior or adding validation to detect and handle port numbers in the address.

Suggested change
if not args.server.startswith("tcp://") and not args.server.startswith("ipc://"):
args.server = f"tcp://{args.server}"
server_input = args.server
if not server_input.startswith("tcp://") and not server_input.startswith("ipc://"):
# Detect and reject ambiguous "host:port" inputs without a scheme.
# Users should either:
# - provide a full ZeroMQ URL (e.g., "tcp://localhost:5555"), or
# - specify the host via --server and the port via --dealer-port.
if server_input.count(":") == 1:
host_part, port_part = server_input.rsplit(":", 1)
if port_part.isdigit():
parser.error(
"Server address must not include a port when no scheme is given. "
'Use "--server HOST --dealer-port PORT" or provide a full URL like '
'"tcp://HOST:PORT".'
)
args.server = f"tcp://{server_input}"

Copilot uses AI. Check for mistakes.
@from2001 from2001 marked this pull request as ready for review January 28, 2026 14:29
@from2001 from2001 merged commit 1a6a974 into develop Jan 28, 2026
6 checks passed
@from2001 from2001 deleted the claude/issue-319-20260128-1359 branch January 28, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client simulator option

2 participants