Skip to content
Open
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
6 changes: 6 additions & 0 deletions agentmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ def run(self):
parser.add_argument('--verbose', action='store_true')
parser.add_argument('--nobg', action='store_true')
args, _unknown = parser.parse_known_args()
if _unknown and not args.reflect:
# Reject unknown CLI flags unless we are in --reflect mode, where
# extra key/value pairs are forwarded to the reflect script.
# Without this guard, typos like `--goal` silently fall through to
# interactive mode and the process looks alive without doing any work.
parser.error(f"unrecognized arguments: {' '.join(_unknown)}")
_reflect_args = dict(zip([k.lstrip('-') for k in _unknown[::2]], _unknown[1::2])) if _unknown else {}

if args.task and not args.nobg:
Expand Down