Skip to content
Open
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
2 changes: 1 addition & 1 deletion Dayflow/Dayflow/Core/AI/AgentCLISupport+Parsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ extension AgentCLISupporting {
durationMinutes = Double(endSeconds - startSeconds) / 60.0
}

if durationMinutes < 10 && index < cards.count - 1 {
if durationMinutes < 1 && index < cards.count - 1 {
let msg = String(
format: "Card %d '%@' is only %.1f minutes long", index + 1, card.title, durationMinutes)
return (false, msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,9 @@ extension GeminiDirectProvider {
durationMinutes = Double(endSeconds - startSeconds) / 60.0
}

// Check if card is too short (except for last card)
if durationMinutes < 10 && index < cards.count - 1 {
// Reject only invalid or near-zero middle fragments. Short context
// transitions should not fail an otherwise usable activity-card batch.
if durationMinutes < 1 && index < cards.count - 1 {
return (
false,
"Card \(index + 1) '\(card.title)' is only \(String(format: "%.1f", durationMinutes)) minutes long"
Expand Down
14 changes: 11 additions & 3 deletions Dayflow/DayflowTests/CodexClaudeProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,27 @@ final class CodexClaudeProviderTests: XCTestCase {
)
}

func testLegacyCardDurationOnlyRejectsShortNonFinalCards() {
func testLegacyCardDurationAllowsShortTransitionsButRejectsInvalidRanges() {
XCTAssertTrue(
claudeProvider.validateTimeline([
card(start: "9:00 AM", end: "10:30 AM", title: "Long card"),
card(start: "10:30 AM", end: "10:35 AM", title: "Short final card"),
]).isValid
)
XCTAssertFalse(

XCTAssertTrue(
claudeProvider.validateTimeline([
card(start: "9:00 AM", end: "9:05 AM", title: "Short non-final card"),
card(start: "9:00 AM", end: "9:05 AM", title: "Short transition"),
card(start: "9:05 AM", end: "9:20 AM", title: "Final card"),
]).isValid
)

XCTAssertFalse(
claudeProvider.validateTimeline([
card(start: "9:00 AM", end: "9:00 AM", title: "Invalid non-final card"),
card(start: "9:00 AM", end: "9:20 AM", title: "Final card"),
]).isValid
)
}

func testLegacyCardValidationNormalizesConfiguredCategories() {
Expand Down