Fix completed habits consuming the free cap (ORB-185) - #455
Conversation
|
Approach:
This keeps the fix at the two count sites instead of changing the entity or global query filter because completion is relevant to this allowance, while completed habits remain valid persisted records elsewhere. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c65f70cd6
ℹ️ 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".
|
DEGRADED: same-vendor review Review verdict: clean after round 1. No Blocking or Non-blocking findings against the frozen rubric. This used a fresh Sol xhigh session; same-family bias is not eliminated and its magnitude is unmeasured. |
|
Current-head fix approach:
This keeps the allowance definition in PayGateService, avoids duplicating cap logic, and stays within the existing file cap. |
|
CI drift plan update: The direct IPayGateService constructor parameter changed the generated handler architecture map. I will move that dependency into the existing LogHabitServices group, wire it in ServiceCollectionExtensions.AiServices.cs, and keep the handler behavior and focused regressions unchanged. This restores the existing architecture shape and uses the eighth and final allowed file. |
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaec4b0845
ℹ️ 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".
| ClearEndDate: request.ClearEndDate, | ||
| ScheduledReminders: opts.ScheduledReminders, | ||
| Emoji: request.Emoji)); | ||
| var result = await HabitReactivationAllowance.ExecuteAsync( |
There was a problem hiding this comment.
Gate reactivation in the registered update_habit tool
When a free user already has 10 active root habits and asks Astra or MCP to clear or extend the end date of a completed recurring root, this gate is never reached: UpdateHabitTool.ExecuteAsync calls habit.Update(updateParams) directly, and chat persistence subsequently saves the reopened habit, leaving 11 active roots. Fresh evidence after the earlier fix is this separate registered update_habit mutation path; route it through the same allowance check or command.
Useful? React with 👍 / 👎.



DEGRADED: same-vendor review
Implements ORB-185.
Summary
Scope choice
The allowance remains defined by PayGateService and is applied only when a completed top-level habit would become active. Sub-habits do not consume the top-level allowance. No IsDeleted clause was added because the repository's global query filter already excludes soft deleted habits.
Verification