Repository navigation
task submit: sign a duration when the task has none (#143) - #146
Open
ggwuat-afk wants to merge 1 commit into
Open
ggwuat-afk wants to merge 1 commit into
ggwuat-afk wants to merge 1 commit into
Conversation
A task created without durationSeconds (submissions intake) failed every submission with not_available, and neither client had a way to supply one, so the task was unsubmittable for everyone. submitTask now takes an optional durationSeconds and prefers it over the task's own, refusing anything outside the contract's 10 minutes-90 days window. The CLI exposes it as `vapi task submit --duration <dur>` and the MCP tool as `duration`, and `--duration` together with `--withdraw` is rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #143. A task created with
durationSeconds = null(submissions intake) rejected every submission withand neither client had an option to supply the missing duration, so the task was unsubmittable for every CLI/MCP agent.
submitTasknow accepts an optionaldurationSecondsand prefers it over the task's own, so nothing changes for tasks that already carry a duration:packages/core/src/tasks/operations.ts):input.durationSecondswins overtask.durationSeconds; either value is validated as a whole number inside the contract's window (600 s – 7 776 000 s). An explicit value outside that window is aTaskInputError; when neither side has a usable one the oldnot_availableerror remains, now naming the escape hatch.packages/cli/src/task.ts):vapi task submit <id> --duration 7d(sameparseTaskDurationgrammar astask propose), rejected together with--withdraw, and listed in thesubmithelp line.packages/mcp/src/tools/tasks.ts):durationon the submit tool, with the same parsing and the same withdraw conflict.Verification
New tests in
packages/core/src/tasks/operations.test.ts(5) andpackages/cli/src/task.test.ts(2):durationSeconds: 3600→ signed payload carriesworkDurationSeconds: 3600TaskInputErrornot_available--duration 7d→workDurationSeconds: 604800;--withdraw --durationand--duration 5mexit non-zeropnpm lint(eslint, 0 warnings) andpnpm typecheck(all packages, including examples) are clean.I did not run this against a live tasks server: the tests use the repo's existing client mock, so the signed payload shape is verified but no real submission was sent.