Skip to content

fix(config): dual-emit for heartbeat null-mismatch and equal-values#25731

Merged
siddseethepalli merged 1 commit into
mainfrom
swarm/39f2/task-25685
Apr 15, 2026
Merged

fix(config): dual-emit for heartbeat null-mismatch and equal-values#25731
siddseethepalli merged 1 commit into
mainfrom
swarm/39f2/task-25685

Conversation

@siddseethepalli
Copy link
Copy Markdown
Contributor

@siddseethepalli siddseethepalli commented Apr 15, 2026

Addresses Codex P1 + Devin 🚩 feedback on #25685.

Converts both heartbeat superRefine issues (null-mismatch and equal-values) to dual-emit, mirroring the filing schema fix. Single-emit cascades to a full-config defaults reset when the retry hits a new mismatch, wiping unrelated keys like maxTokens:

  • { start: null, end: 8 } → strip start → default 8 → equal check fires → full-defaults fallback.
  • { start: 22, end: 22 } → strip end → default 22 → equal check fires again → full-defaults fallback.

Dual-emit strips both sides in one pass so both defaults restore cleanly.

Adds test coverage for the three cascade scenarios ({ start: null, end: 8 }, { start: 22, end: null }, { start: 22, end: 22 }) confirming maxTokens survives revalidation.


Open with Devin

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 635442ee0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +59 to +62
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ["activeHoursEnd"],
message,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve non-null hour when fixing null mismatch

Adding an issue on activeHoursEnd here causes validateWithSchema to delete both keys for any mixed-null input, so configs like { activeHoursStart: null, activeHoursEnd: 20 } are rewritten to defaults (8, 22) instead of retaining the valid explicit 20. This is a behavioral regression from the previous repair strategy and can silently widen heartbeat windows for users who only made one side null.

Useful? React with 👍 / 👎.

Comment on lines 82 to +85
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ["activeHoursEnd"],
message:
"heartbeat.activeHoursStart and heartbeat.activeHoursEnd must not be equal (would create an empty window)",
message,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep one explicit hour when resolving equal-hour config

Emitting an additional issue on activeHoursStart makes cleanup drop both sides for every equal-hours input, so { activeHoursStart: 5, activeHoursEnd: 5 } now falls back to (8, 22) instead of preserving one explicit value (previously repaired to 5/22). The cascade you’re fixing only requires dual-emit for the default-collision case (22/22), so this broad change introduces avoidable data loss for other equal-hour typos.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@siddseethepalli
Copy link
Copy Markdown
Contributor Author

Addressed in #26266 — heartbeat superRefine now emits only on the null side (for null-mismatch) and only on activeHoursEnd (for equal-hours), preserving valid explicit values instead of deleting both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant