Skip to content

idle-check.py: one non-object JSONL line stops the full idle scan #118

Description

@royosherove

In idle-check.py line 166, the code catches only JSONDecodeError and KeyError.

If a line is valid JSON but is not an object (for example [] or "x"), obj.get raises AttributeError. This error goes out of the loop, and the full scan gives SCAN_ERROR.

Fix: skip lines that are not a dict (if not isinstance(obj, dict): continue), or also catch AttributeError.

Found by a static read of the code at commit 1f66a8f. The code was not run.

Activity

  1. royosherove commented on Oct 11, 2026

    @royosherove
    MemberAuthor

    👻 Andromeda is on this · Kiro Crew Issue Radar
    awaiting-merge · PR #126 · updated 11:29 UTC

    Fix in #126. Root cause: find_idle_hours() in bootstraps/optional/idle-shutdown/idle-check.py called obj.get on every parsed line. For a valid line that is not an object, this raises AttributeError, which except (json.JSONDecodeError, KeyError) does not catch, so --idle-hours printed SCAN_ERROR. The scan now skips a line that is not a dict. I did not widen the except, because that can also hide real bugs in later code. A new case 9 in tests/test-idle-check.sh fails on main (SCAN_ERROR unexpected: 'list' object has no attribute 'get') and passes with the fix. CI is green and the Codex review has no findings. Auto-merge is off in this repo, so the PR waits for a maintainer to merge it.

    progress
    • 11:24 claimed -- find_idle_hours() calls obj.get on every parsed line; a valid non-object line raises AttributeError, which is not caught, so --idle-hours prints SCAN_ERROR. No open PR touches this file.
    • 11:25 regression test fails on main (8 pass, 1 fail), passes with the fix (9 of 9)
    • 11:25 opened PR fix(idle-shutdown): skip non-object JSONL lines in idle-check #126
    • 11:29 CI 19/19 green; Codex review has no findings; waiting for a human merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrew: in progressIssue Radar work claimed by a Kiro Crew worker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions