Skip to content

Autonomous AI sales agent powered by Claude Code or Codex. Finds prospects, writes cold emails, sends campaigns, handles replies, books meetings. No API keys needed — runs on your Claude or Codex subscriptions.

Keep harvey status working with an invalid config; changelog notes

Ethand0e39a0e7103
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5804da0..ece3ace 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,10 +19,13 @@ minor versions can still change behaviour.
approval queue, so with `channels.email.require_approval: true` (the default)
Harvey now holds campaign deployment and hands replies to a human instead of
silently bypassing the setting. `harvey run` and `harvey status` say when this
- is happening; prospecting and drafting carry on. Set
- `require_approval: false` for Instantly autopilot.
+ is happening; prospecting and drafting carry on (drafts wait, using model
+ quota, until sending is allowed). Set `require_approval: false` for
+ Instantly autopilot.
- Disable LinkedIn by default in the model, sample config, and product trainer;
save the setup wizard's explicit LinkedIn choice when updating a config.
+ Answering "no" to LinkedIn when re-running `harvey setup` now turns it off
+ (saved credentials stay in `.env`).
- Protect the local dashboard with an access token, restrict requests to trusted
local origins, and save settings with owner-only permissions. Update and restart
Harvey, then open the dashboard link printed in your terminal.
diff --git a/harvey/cli.py b/harvey/cli.py
index bcd4423..7caf06b 100644
--- a/harvey/cli.py
+++ b/harvey/cli.py
@@ -209,10 +209,12 @@ def cmd_status(args):
by_provider = summary.get("usage_today_by_provider", {})
print(f" Claude calls today: {by_provider.get('claude', summary['usage_today'])}")
print(f" Codex calls today: {by_provider.get('codex', 0)}")
- from harvey.config import ConfigError, load_config, sending_notice
+ from harvey.config import load_config, sending_notice
try:
notice = sending_notice(load_config())
- except ConfigError:
+ except Exception:
+ # Status must still print when harvey.yaml is broken; that's
+ # when people run it. The --check path reports config errors.
notice = ""
if notice:
print(" Sending: HELD")
diff --git a/tests/test_security_defaults.py b/tests/test_security_defaults.py
index 479841d..0ae9008 100644
--- a/tests/test_security_defaults.py
+++ b/tests/test_security_defaults.py
@@ -165,3 +165,26 @@ async def test_training_on_a_local_url_says_why_it_was_refused():
crawler = FallbackCrawler()
assert await crawler.crawl("http://localhost:3000", max_pages=3) == {}
assert crawler.blocked is True
+
+
+def test_status_still_works_when_the_config_is_invalid(tmp_path, monkeypatch, capsys):
+ # `harvey status` is what people run when something's wrong, so an
+ # invalid harvey.yaml must not crash the sending-hold check.
+ import harvey.config
+ import harvey.state
+ from harvey.cli import cmd_status
+ from harvey.config import HarveyConfig
+ from pydantic import ValidationError
+
+ def invalid():
+ HarveyConfig(channels={"email": {"max_daily_sends": "lots"}})
+
+ try:
+ invalid()
+ except ValidationError:
+ pass
+ real_state = harvey.state.StateManager
+ monkeypatch.setattr(harvey.state, "StateManager", lambda: real_state(str(tmp_path / "s.db")))
+ monkeypatch.setattr(harvey.config, "load_config", invalid)
+ cmd_status(SimpleNamespace(check=False))
+ assert "Prospects:" in capsys.readouterr().out