Confirmed silent time-parsing error
Reviewed master at 886c36d8ebe861aa987059a1744d45b78797baae (v4.7.0). Suggested priority: P2.
parse_time's relative-duration branch uses an unanchored prefix match and immediately returns after the first amount/unit. It accepts a compound expression while silently ignoring the remaining duration.
Reproduction
parse_time("in 1 hour 30 minutes", now=datetime(2026, 1, 1, tzinfo=UTC))
Actual: 2026-01-01T01:00:00+00:00
Expected: 2026-01-01T01:30:00+00:00, or an explicit unsupported-expression error
Independently reproduced twice with the pinned source. The schedule tool directs callers to use parse_time for natural-language one-time scheduling, so this can silently schedule work 30 minutes early.
Acceptance criteria
- Consume the complete supported expression, or reject unconsumed input.
- Prefer parsing supported compound amount/unit pairs; rejection is still safer than a confidently wrong timestamp.
- Test compound hours/minutes and days/hours, whitespace, malformed suffixes and existing single-unit inputs.
Behavior change: currently accepted but misinterpreted compound inputs get correct results or explicit errors. Broader natural-language syntax is not required by this bug. No source changes were made.
Confirmed silent time-parsing error
Reviewed
masterat886c36d8ebe861aa987059a1744d45b78797baae(v4.7.0). Suggested priority: P2.parse_time's relative-duration branch uses an unanchored prefix match and immediately returns after the first amount/unit. It accepts a compound expression while silently ignoring the remaining duration.Reproduction
Independently reproduced twice with the pinned source. The schedule tool directs callers to use
parse_timefor natural-language one-time scheduling, so this can silently schedule work 30 minutes early.Acceptance criteria
Behavior change: currently accepted but misinterpreted compound inputs get correct results or explicit errors. Broader natural-language syntax is not required by this bug. No source changes were made.