The --resume flag was being ignored when --agent and --chat flags were used together. The if-else chain checked for chat mode first and immediately returned None, skipping the --resume check entirely. Reordered the logic to check flags.resume first, ensuring explicit --resume is always honored regardless of other flags. Fixes: --resume not working with --agent --chat