You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plugin: the agent-output readers crash on a JSON line that is not an object #182
Five readers of agent CLI output parse each line with json.loads and then call .get on the result, without the isinstance(ev, dict) check — the same gap #150 closed for the trace readers (and #181 for the cursor pair):
plugin/probe.pyinspect_session — Copilot's own events.jsonl: json.loads(line).get("data") (this one also has no except ValueError, so a partially-written or corrupt line containing "hook.end" crashes before .get is even reached)
plugin/toolcheck.py_init_tools — claude -p --output-format stream-json stdout: ev.get("type")
A line that is valid JSON but not an object (null, 42, "text", [1, 2]) — or, for inspect_session, any line with the "hook.end" prefilter that does not parse — raises and kills the whole probe / side call / tool check, instead of skipping the one line.
These are external-process streams, same exposure as the transcripts #150 hardened: anything the CLI or a tool it spawns writes to inherited stdout lands line-shaped in these loops.
Repro
>>> # sidecall.codex_call with a stubbed runner whose stdout is:
"null\n{\"type\":\"item.completed\",\"item\":{\"type\":\"agent_message\",\"text\":\"hi\"}}\n"
AttributeError: 'NoneType' object has no attribute 'get'
Fix
The same one-line isinstance(ev, dict) guard after json.loads in the four loops, plus the ValueError catch in inspect_session. I have it with regression tests ready and will open the PR.
Activity
plugin: skip JSON lines that are not objects in the agent-output readers
plugin: skip nested non-objects in the agent-output readers
sidecall: read a usage that is not an object as none
fix(microskills): skip non-dict JSON lines in load_calls