Report a failed apt simulation instead of reading it as "no updates" #23

Merged
patrick merged 2 commits from fix/apt-simulation-failure into main 2026-10-31 03:28:45 +00:00
Owner

The agent ran apt-get -s dist-upgrade 2>/dev/null || true, so when apt failed
(unmet dependencies, a broken sources entry, a damaged package cache) the empty
output counted as zero updates and the host could show ok.

  • Agent 0.5.0 keeps apt's exit status and stderr, reports apt_simulation_ok and
    apt_simulation_error (the first E: line), and sends the update counts as null.
  • The server puts such a host in update ("apt can't work out pending updates: …");
    the host page shows the result. Agents before 0.5.0 are judged as before.
  • Host history shows "–" instead of "None" for an unknown count.
  • The status CLI tests no longer hard-code the agent version.

After merging, redeploy the agents (agent/deploy.sh); until then every host
shows the "agent is older" note.

Still to verify on a real host: whether an interrupted dpkg makes the
lock-free simulation fail. If it doesn't, the planned dpkg --audit check
covers it.

🤖 Generated with Claude Code

The agent ran `apt-get -s dist-upgrade 2>/dev/null || true`, so when apt failed (unmet dependencies, a broken sources entry, a damaged package cache) the empty output counted as zero updates and the host could show `ok`. - Agent 0.5.0 keeps apt's exit status and stderr, reports `apt_simulation_ok` and `apt_simulation_error` (the first `E:` line), and sends the update counts as null. - The server puts such a host in `update` ("apt can't work out pending updates: …"); the host page shows the result. Agents before 0.5.0 are judged as before. - Host history shows "–" instead of "None" for an unknown count. - The status CLI tests no longer hard-code the agent version. After merging, redeploy the agents (`agent/deploy.sh`); until then every host shows the "agent is older" note. Still to verify on a real host: whether an interrupted dpkg makes the lock-free simulation fail. If it doesn't, the planned `dpkg --audit` check covers it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrick added 1 commit 2026-10-31 03:22:48 +00:00
Report a failed apt simulation instead of reading it as "no updates"
CI / tests (Python 3.10) (pull_request) Successful in 26s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 25s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Failing after 3s
6d29197cfc
The agent ran `apt-get -s dist-upgrade 2>/dev/null || true`, so when apt
failed (unmet dependencies, a broken sources entry, a damaged package cache)
the empty output counted as zero updates and the host could show ok while
nothing could be installed. The agent now keeps apt's exit status and stderr,
reports apt_simulation_ok and the first "E:" line as apt_simulation_error,
and sends the update counts as null. The server puts such a host in update
with "apt can't work out pending updates: ...", and the host page shows the
result. Agents before 0.5.0 don't send the field and are judged as before.

Also show "–" rather than "None" for an unknown count in a host's history,
and stop hard-coding the agent version in the status CLI tests. Agent 0.5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick added 1 commit 2026-10-31 03:25:50 +00:00
Quote an empty local in the agent for shellcheck (SC1007)
CI / tests (Python 3.10) (pull_request) Successful in 26s
CI / tests (Python 3.11) (pull_request) Successful in 25s
CI / tests (Python 3.12) (pull_request) Successful in 26s
CI / tests (Python 3.13) (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 3s
fc6ee03ae5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick merged commit 669f1dc545 into main 2026-10-31 03:28:45 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: patrick/kernel-automation#23