Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ This repository orchestrates multi-project agent workflows. Keep behavior projec
5. Keep run-state path logic in `src/state.ts`.
6. Keep CLI parsing and dispatch in `src/args.ts` and `src/index.ts`.
7. Do not construct raw shell command strings in workflow logic; use helper modules.
8. Keep review parsing contract stable:
8. Keep TypeScript files under 250 lines; split files before they grow beyond that limit.
9. Keep review parsing contract stable:
- `RESULT: PASS|FAIL`
- `SUMMARY: ...`
- `BUGS_JSON: [...]`
9. Add tests for any new CLI flag, config shape, state path, or stage transition.
10. Add tests for any new CLI flag, config shape, state path, or stage transition.

## Quality Gates

Expand Down
36 changes: 25 additions & 11 deletions tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,24 @@ describe("loadConfig", () => {
});

it("loads notification settings from RESEND env vars", async () => {
const tempDir = await mkdtemp(
path.join(process.cwd(), ".tmp-config-test-"),
);
process.env.RESEND_API_KEY = "re_test_key";
process.env.RESEND_FROM = "ADHD.ai <ops@example.com>";
process.env.RESEND_TO = "a@example.com,b@example.com";
const config = await loadConfig(process.cwd());
expect(config.notifications.email.enabled).toBe(true);
expect(config.notifications.email.resendApiKey).toBe("re_test_key");
expect(config.notifications.email.from).toBe("ADHD.ai <ops@example.com>");
expect(config.notifications.email.to).toEqual([
"a@example.com",
"b@example.com",
]);
try {
const config = await loadConfig(tempDir);
expect(config.notifications.email.enabled).toBe(true);
expect(config.notifications.email.resendApiKey).toBe("re_test_key");
expect(config.notifications.email.from).toBe("ADHD.ai <ops@example.com>");
expect(config.notifications.email.to).toEqual([
"a@example.com",
"b@example.com",
]);
} finally {
await rm(tempDir, { recursive: true, force: true });
}
});

it("supports disabling notifications even with RESEND_API_KEY", async () => {
Expand Down Expand Up @@ -314,12 +321,19 @@ describe("loadConfig", () => {
});

it("rejects missing sender when notifications are enabled", async () => {
const tempDir = await mkdtemp(
path.join(process.cwd(), ".tmp-config-test-"),
);
process.env.RESEND_API_KEY = "re_test_key";
process.env.RESEND_FROM = "";
process.env.RESEND_TO = "a@example.com";
await expect(loadConfig(process.cwd())).rejects.toThrow(
"notifications.email.from (or RESEND_FROM) is required when email notifications are enabled",
);
try {
await expect(loadConfig(tempDir)).rejects.toThrow(
"notifications.email.from (or RESEND_FROM) is required when email notifications are enabled",
);
} finally {
await rm(tempDir, { recursive: true, force: true });
}
});

it("rejects project-level notification overrides", async () => {
Expand Down