Delegate a bug. Get back a tested fix.

Assign a bug to Cyrus. It reproduces it, writes a failing test, and ships the smallest fix.

E Engineering › ENG-517☆  ···‹  3 / 14  ›

Discount codes apply twice when the cart is edited

Reported by two customers today. Apply a code, change a quantity, and the discount is subtracted a second time at checkout.

ActivityUnsubscribe
PPriya Nair delegated to Cyrus31m ago
CyrusAgent6m agoCompleted
Quantity changes re-run applyDiscount on an already-discounted total.
Added cart.test.ts › keeps one discount after editfails as reported
Edited src/cart/pricing.ts
Ran pnpm test cart48 passed
Opened acme/web#1302

Root cause: recalculate() applied the discount to the discounted subtotal instead of the original. The fix computes from line items every time. A regression test is included in acme/web#1302.

Delegate straight from the backlog

Assign the issue to Cyrus, or label it and let an automation route it. Each bug gets its own worktree, so several can be fixed in parallel.

In Progress 2
ENG-521Avatar upload fails for HEIC images BugNov 20
ENG-519Timezone shown as UTC in weekly digest BugNov 20
In Review 2
ENG-517Discount codes apply twice when the cart is edited#1302 BugNov 20
ENG-514Search ignores archived filter on mobile#1299 BugNov 19

Reproduce first, then fix

Cyrus writes a test that fails for the reported reason before it changes any code. The fix is the smallest change that turns that test green.

⌄src/cart/pricing.test.ts+8 −0
@@ -88,0 +88,8 @@ describe("recalculate", () => {
88+ it("keeps one discount after a quantity edit", () => {
89+ const cart = cartWith({ sku: "TEE", qty: 1, price: 4000 });
90+ applyCode(cart, "SAVE10");
91+ setQuantity(cart, "TEE", 2);
92+
93+ expect(cart.total).toBe(7200);
94+ });

Progress where you are watching

Cyrus posts what it tried and found to the issue as it works. Reply on the issue to redirect it at any point.

CyrusAgentjust now Working
Reproducing with a HEIC sample from the bug report.
Added upload.test.ts › accepts HEICfails as reported
sharp is built without libheif in the API image.
Edited Dockerfile
Running pnpm test upload

How Cyrus does it

  1. Delegate the issue

    Assign it to Cyrus in Linear or Plane, or let a label route it.

  2. Cyrus reproduces it

    It writes a failing test in an isolated worktree.

  3. It fixes the root cause

    It makes the smallest change that turns the test green.

  4. You review the PR

    The fix arrives with the test and an explanation of the cause.

More automations

Security patching Dependency advisories become tested pull requests.

E Engineering › ENG-482☆  ···‹  3 / 14  ›

Patch high-severity axios advisory

Dependabot alert #37 on acme/web: axios before 1.21.0 can forward credentials across cross-origin redirects. Severity: High.

ActivityUnsubscribe
DDependabot created the issue via GitHub14m ago
Security patching automation delegated to Cyrus14m ago
CyrusAgent2m agoCompleted
axios is a direct dependency of web and a transitive one through @acme/sdk.
Ran pnpm up axios@1.21.0 -r
Ran pnpm audit --prod0 vulnerabilities
Ran pnpm test312 passed
Opened acme/web#1294

Upgraded axios to 1.21.0 in web and @acme/sdk and refreshed the lockfile. The audit is clean and all 312 tests pass.

No code changes were needed. Ready for review in acme/web#1294.

Code review A careful first review on every pull request.

Add exponential backoff to email worker by mchen×
github.com/acme/api/pull/1291
acme / apiType / to search

Add exponential backoff to email worker #1291

Openmchen wants to merge 2 commits into main from mchen/email-backoff
Conversation3Commits2Checks4Files changed2
cyrusagent bot reviewed 4 minutes ago
⌄src/workers/email.ts+9 −2
4141 } catch (err) {
42- await sleep(5 * 60_000);
42+ const delay = Math.min(2 ** job.attempt * 1000, 120_000);
43+ await sleep(delay);
cyrusagentbot4 minutes ago
Resend sends a Retry-After header on 429s. Prefer it when present so we don’t retry before the window resets:
Suggested change
- const delay = Math.min(2 ** job.attempt * 1000, 120_000);
+ const delay = retryAfterMs(err) ?? Math.min(2 ** job.attempt * 1000, 120_000);
Commit suggestion
cyrusagent approved these changes just now

Dev support Answers from your codebase, right in Slack.

←  →  ◷Search Acme?
# eng-support ⌄M24
MessagesCanvasFiles
Yesterday ⌄
P
Priya Nair2:14 PM
@Cyrus where do we set the session timeout for the dashboard?
2 repliesLast reply yesterday at 2:20 PM
S
Sam Okafor4:47 PM
Staging is back up after the database migration. Thanks for your patience, everyone.
If anything looks off, drop it in this channel.
Today ⌄
Connor9:12 AM
Reminder: on-call handoff moves to Thursdays starting next week.
S
Sam Okafor9:58 AM
@here web 2.41 is out. Release notes are in #product.
M
Maya Chen10:31 AM
@Cyrus customers say signup confirmation emails are arriving 10+ minutes late since yesterday. Can you take a look?
👀 1🙏 2
M3 repliesLast reply today at 10:38 AM
B I S 🔗 ≔ </>
Message #eng-support
+  Aa  ☺  @➤

Approvals Routine fixes and security patches approved fast, by your code owners.

Bump axios to 1.21.0 by cyrusagent×
github.com/acme/web/pull/1294
acme / webType / to search

Bump axios to 1.21.0 #1294

Opencyrusagent wants to merge 1 commit into main from cyrus/eng-482-patch-axios
Conversation3Commits1Checks4Files changed2
cyrusagentbotcommented 2 minutes agoContributor···
Change riskLow 12
2 filesLockfile and package.json only312 tests pass
Risk of waitingHigh 81
High-severity advisoryCredentials exposed on redirectFix available

Pre-cleared by @mchen for dependency patches in web/. Requesting her approval.

M
mchen approved these changes Pre-cleared via Cyrusjust now
Changes approved
1 approving review by mchen
All checks have passed
4 successful checks
No conflicts with base branch
Merging can be performed automatically.
Merge pull request ▾You can also merge this with the command line.

Clear the bug backlog

Start a 7-day free trial on Pro or Team. Setup takes minutes.