Skip to content

fix(zaptec_cloud): a refused stand-down returns false (0.2.2) - #247

Merged
frahlg merged 2 commits into
mainfrom
default-mode-says-when-stop-failed
Nov 21, 2026
Merged

frahlg merged 2 commits into
mainfrom
default-mode-says-when-stop-failed

Conversation

@frahlg

@frahlg frahlg commented Nov 21, 2026

Copy link
Copy Markdown
Member

What

  • zaptec_cloud 0.2.2. driver_default_mode returns false when the stand-down is refused.
    • It returns true only when the 0 A write or the pause (506) held, or when FTW wrote nothing in this run.
    • It retries a refused stand-down once a minute instead of every five minutes, and returns false in between, so it still settles.
  • docs/WRITING-A-DRIVER.md. "Report the default as held once you give up" now applies only to a device FTW never steered, such as an absent register or a block another EMS owns. For a device FTW commanded in this run, a refused stand-down returns false.

Why

Core reads true, or nothing, from driver_default_mode as "stood down". It then unblocks control and stops retrying (registry.go markDefaultConfirmed). zaptec_cloud 0.2.1 returned nothing even when both the 0 A write and the pause failed. A charger that kept charging, for example during a stale-meter stand-down, therefore looked held to Core.

The review of #246 found the same pattern there, in the "report held after three refusals" rule. #242 (merged) and #244 follow that rule too. Their authors are fixing it in follow-ups with the same rule.

Evidence

  • New harness cases:
    • a refused stand-down returns false, does not rewrite inside a minute, returns false again on the next try, and returns true once it holds;
    • a held pause with a failed 0 A write counts as stood down;
    • a fresh driver returns true and writes nothing.
  • A mutation that returns true after a failure fails the test.
  • make check passes (4 997 passed).
  • The FTW gopher-lua runtime probe passes.

Refs #240, #243.

🤖 Generated with Claude Code

Core reads a driver_default_mode result of true or nil as "stood down"
and then unblocks control and stops retrying. zaptec_cloud returned nil
even when both the 0 A write and the pause failed, so a charger that
kept charging looked held. It now returns true only when the write or
the pause held, or when FTW wrote nothing in this run, and retries a
refused stand-down once a minute.

WRITING-A-DRIVER.md: "report held once you give up" is for a device
FTW never steered, not for a charger it commanded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T17:30:59.859225Z a263908 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…efused 0 A write

Review of #247: the driver kept the old current as written, so a manual
resume would have offered it until Core's next order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg merged commit 504b0dd into main Nov 21, 2026
5 checks passed
@frahlg
frahlg deleted the default-mode-says-when-stop-failed branch November 21, 2026 17:34
frahlg added a commit that referenced this pull request Nov 21, 2026
Brings in #247. The generated files regenerate unchanged.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant