Repository navigation
Commit 01b690b
fix(codex): try alternate timestamp fields when top-level timestamp is malformed
The model-date resolution chain in codex_model_timestamp_from_result used
raw_or_normalized_codex_timestamp, which returned any non-empty string as-is
regardless of whether it parsed as a date. That short-circuited the or_else
chain, so a malformed top-level `timestamp` would prevent the parser from
looking at `created_at`, `created_at_camel`, nested result-field
timestamps, or the file mtime fallback, and forced events through the
conservative gpt-5 mapping.
Validate the raw string against codex_timestamp_date before short-circuiting;
fall through to normalize_codex_timestamp / normalize_value_timestamp and
finally None so the rest of the chain can supply a valid date. Mirror the
same change for the serde_json::Value path.
Also fix the models.dev fallback generator so a gpt-5.x decimal base model is
only dropped when a gpt-5.x-codex variant exists on the SAME release date.
When the codex variant ships later, keeping the base entry lets events in the
gap still resolve to the most recent model actually available then.
Co-authored-by: Codesmith <[email protected]>1 parent 3d80f23 commit 01b690b
3 files changed
Lines changed: 68 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
| |||
610 | 614 | | |
611 | 615 | | |
612 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
613 | 620 | | |
614 | 621 | | |
615 | | - | |
| 622 | + | |
| 623 | + | |
616 | 624 | | |
617 | 625 | | |
618 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
619 | 654 | | |
620 | 655 | | |
621 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
843 | 853 | | |
844 | 854 | | |
845 | 855 | | |
| |||
874 | 884 | | |
875 | 885 | | |
876 | 886 | | |
877 | | - | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
878 | 895 | | |
879 | 896 | | |
880 | 897 | | |
| |||
0 commit comments