-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add Replicate-Max-Lifetime header and prediction deadline field #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new Replicate-Max-Lifetime request header across prediction-creation endpoints and introduces a deadline timestamp field in prediction responses. Updates the OpenAPI spec to define the header, reference it in relevant operations, and expose the absolute cancellation time in the prediction schema. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant API as Replicate API
participant S as Scheduler/Worker
Note over C,API: Prediction creation with optional Replicate-Max-Lifetime header
C->>API: POST /predictions (Replicate-Max-Lifetime: "5m")
API->>API: Parse duration, compute deadline = now + lifetime
API->>S: Create prediction job with deadline
API-->>C: 201 Created { ..., deadline: ISO-8601 }
Note over S: Run prediction until completion or deadline
alt completes before deadline
S-->>API: status=success
API-->>C: GET /predictions/{id} -> success (deadline unchanged)
else exceeds deadline
S->>API: timeout reached
API->>S: cancel job
API-->>C: GET /predictions/{id} -> status=canceled
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (7)
📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Documentation