Repository navigation
fix: stories list takes ISO datetimes and nullable parameters keep their real type - #15
Merged
Merged
Conversation
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.
What
asknews stories listsent whatever was typed after--start-timestampto the API as a string. The help labelled the option[query, string, optional], so an agent following the help naturally typed an ISO datetime (asnews search --start-datetimeandx --start-datetimetake) and got back422: Input should be a valid integer. In an agent evaluation, three different models hit that 422 on their firststories listcall and only recovered by retrying with Unix seconds.Changes
stories listtime bounds. New--start-datetime/--end-datetime(ISO 8601), mirroringnews searchandx.--start-timestamp/--end-timestampkeep the API's names, take Unix seconds, and accept an ISO datetime too; a value that is neither fails locally with a usage error instead of a 422.--hours-backkeeps working as before.anyOf: [{type: X}, {type: "null"}]with no top-leveltype, which the generator collapsed tostring. 45 parameters were mislabelled this way (17 integers, 21 arrays, 4 numbers, 3 booleans), so the help misled the reader and the parser never validated them.extractParametersnow reads the one non-null variant:--start-timestampisinteger, array parameters collect and split like the curated ones, enums on the variant becomeChoicesin the help (for example--sort-byonstories list). The manifest, the command reference and the embedded skill references are regenerated from the pinned 0.32.3 schema; no schema refresh is included.apicommands now collect and split. A consequence of the type fix:api news search-news --string-guarantee "climate, change"used to send one elementclimate, changeand now sends two, as the curated commands already do; the JSON form'["climate, change"]'still sends one.stories listthenstories get. The task recipe now says what each step returns and that any question about how a story developed, its timeline or its latest update is answered fromstories get <uuid>, never from the list alone (the list carries one update and no articles). It names the time-bound flags. In the same evaluation no model ever calledstories get; they answered from the list.After review
An independent review pass added three small changes in the second commit:
--start-datetimetogether with--start-timestamp(or the end pair) is a usage error instead of a silent precedence; a boolean parse error names its option (--full-articles expects true or false), which the type fix made reachable; the skill names the update fields (updates[0].headline,updates[0].story).Verification
pnpm lint,pnpm typecheck: clean.pnpm test:coverage: 129 passed, 1 failed. The failure isoutput.test.ts > renders web search with field-accurate columns and provenance, which fails identically on an untouchedmaincheckout in this environment (terminal hyperlink fallback); it is not touched by this change.stories listsendsstart_timestamp/end_timestampas Unix seconds for all three input forms and rejects a non-date; a contract test asserts that every nullable schema parameter's manifest type matches its non-null variant.asknews stories list --helpshows the four time-bound options with their descriptions.Notes
main(live schema 0.32.8 against pinned 0.32.3); that refresh is a separatefix:as usual.pnpm sync:docs), so thestoriespage and the published skill pick this up with the next release.