Skip to content

Issue sorting has different behavior for CLI created issues #8703

@vandit49

Description

@vandit49

Type: Bug

The issues list seems to sort issues created by the CLI in a different fashion. All newly created issues via the web interface are populating in the correct order in the sidebar (most recent first), but issues created via the gh CLI are for some reason in a different spot (usually near the end).

Query settings:

    "githubIssues.queries": [
        {
            "label": "Issues",
            "query": "is:open repo:${owner}/${repository} sort:created-desc",
            "groupby": "none"
        }
    ],

AI Snippet that attempted to debug:

Final finding: there is no API-level difference to sort on. At REST and GraphQL, the two issues are structurally identical (same performed_via_github_app: null, same author_association, same includesCreatedEdit: false, same lastEditedAt: null, empty timelines, empty events). The only fields that differ are identifiers (id, number, node_id), timestamps, and content — and #99 has the later createdAt, so any sane created-desc sort should put it above #98.

Since the data GitHub returns is identical in shape, the mis-sort has to be inside the extension. Most plausible diagnosis now:
- The extension maintains a local cache of issues keyed by number.
- On refresh, it merges new issues into the cache using a strategy that preserves existing positions and appends/inserts new ones somewhere other than server-sorted order.
- Web-created issues happen to still be in the initial "fetch everything" batch shape that gets fully re-sorted; CLI-created issues (created after the cache existed) hit the merge path and slot somewhere odd.

This is an extension bug, not a gh quirk. The fix is in microsoft/vscode-pull-request-github. Worth a quick search on their issues for "sort created"

Extension version: 0.138.0
VS Code version: Code 1.117.0 (10c8e557c8b9f9ed0a87f61f1c9a44bde731c409, 2026-04-21T16:12:14-07:00)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz (20 x 3696)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2208 [NVIDIA GeForce RTX 3080 Ti], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.9579 ACTIVE
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.90GB (19.44GB free)
Process Argv --crash-reporter-id c482cd7d-4022-4e4f-815e-4cbf79f80d8a
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
9b8hh234:30694863
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsdeactivate2:31464701
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31499106
4je02754:31466945
8hhj4413:31478653
38bie571_auto:31426784
cp_cls_t_1081:31454832
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
534a6447:31496642
chat:31457767
dfc2j404:31500885
cpptoolson-v2:31475363
ghj88844:31499326
ec1eg703:31491645
client_tst_t:31495907
ddid_t:31478206
getcmakediagnosticsoff:31489825
cp_cls_c_1082:31491634
logging_enabled_new:31498466
j0d79568:31499440
748c7209:31497895

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions