Skip to content

fix: harden Lua actor, relay, tool-round and runner behavior - #165

Merged
wolfy-j merged 9 commits into
masterfrom
test/lua-runtime-coverage-20261007
Oct 12, 2026
Merged

wolfy-j merged 9 commits into
masterfrom
test/lua-runtime-coverage-20261007

Conversation

@skhaz

@skhaz skhaz commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes

  • Actor: keep registered-channel selection usable after a caught error on older runtimes; deliver buffered values and the final closed-channel notification instead of terminating the actor.
  • Agent: honor an optional stop_check immediately before provider generation. A committed Stop returns { stopped = true } without a provider request.
  • Tool caller: clear previous-round diagnostics, controls and call IDs when a later round has no tools.
  • Relay: count duplicate JOINs once, rebuild the counter from restored memberships on hot upgrade, preserve payloads, reject malformed commands and report failed plugin delivery. Validated route caching remains bounded to 64 entries and is not persisted across upgrades.
  • Test runner: reject replaced plans and error-status results hidden behind otherwise valid BDD results. Preserve master's published teardown ordering, suite deadlines and existing cancellation API.
  • Live-test safety: require the literal true opt-in across provider suites; false, 0 and other strings must not enable calls.

Scope and compatibility

The unpublished benchmark API, workload entries, environment settings and reporting/GC machinery have been removed from this PR. Their original implementation remains recoverable from commit ab8c45a995149b3542f72b706625b85f42c7fc3b.

Existing tool IDs, payloads and stored upgrade shapes are unchanged. stop_check is optional. Normal empty/skip-only test suites remain allowed; WIPPY_TEST_REQUIRE_CASES=1 is an explicit CI opt-in. Duplicate JOIN accounting, malformed relay inputs and invalid test results intentionally stop preserving their buggy behavior.

Current master was merged without rewriting the existing PR history. The published #172 runner teardown implementation is retained. The optional behavior-proposal documentation describes the host contract without assuming which application versions consume it.

Verification

Against verified runtime 0.3.47a / stable go-lua 1.6.5:

  • All 12 module/harness test suites pass: shared Test, runner, Actor, Agent, Relay, LLM, Bootloader, Migration, Embeddings, Usage, Views and Facade. Their lint passes.
  • All 48 make test-runtime cases pass on both 0.3.47a and the installed older 0.3.42a.
  • CLI result/protocol checks, required-case checks, aborted-hook checks and late/silent timeout checks pass.
  • Runner Go verification passes with -race, and go vet passes. It checks teardown-before-next-entry and unchanged explicit suite-deadline semantics.
  • The provider-switch harness executes 49 combinations using the actual Lua switch expressions without contacting providers. Original expressions fail 22 disabled-value cases; corrected expressions pass.
  • The restored relay-counter cases (saved counts 0, 1 and 3 for one membership) prove correct shutdown after final LEAVE; inconsistent counts failed before the fix. All 34 Relay cases and lint pass.
  • The Go harness also passes with CI's exact Go 1.26.5; its module baseline is aligned to Go 1.26.
  • The shared-module benchmark-surface regression failed before removal and passes afterward.
  • Manifest conventions, the three Python convention tests, shell syntax and whitespace checks pass.
  • CI now runs the Go verification harness as well as the real Lua runtime regressions. Final head fb43c36ea1b75e017c0fd44573363beb40dace01 has 24 successful checks.

The initial broad run reached live-provider suites because older switches treated the string false as enabled; it was interrupted. The final rerun had all live opt-ins unset. No new live-provider compatibility or performance-improvement claim is made.

Related follow-ups

Session #61 consumes stop_check. Framework #176 is separate connected-client isolation work; its guard must be retained before the JSON decode when resolving the small relay overlap with this PR.

No merge, publication or deployment.

skhaz added 3 commits October 7, 2026 12:44
…runner

- actor: update select cases in place, so channels registered after a
  handler catches an error are still selected
- agent: honor runtime_options.stop_check before provider generation
- tools: clear wrapper diagnostics and last tool calls on empty rounds
- relay: count a repeated JOIN once, so the last LEAVE stops the session
  plugin
- test runner: fail an error result hidden by a valid plan and reject a
  replaced plan
- relay benchmark: bound pipeline identity slots by the window
- README: state that wippy/session does not consume behavior proposals

Adds runtime regression tests for each fix and edge-case coverage for
buffered actor channels, relay recovery after rejected input, and paired
tool controls.
Validated commands skip the type checks, the plugin prefix scan, and the
topic substring on later messages. The cache holds at most 64 routes and
is not part of the upgrade state. JSON payloads are decoded without a
redundant string conversion.

Relay roundtrip at size 256 against the original baseline, five matched
rounds: median -5.0% to -6.8%, p95 -4.0% to -6.4%, allocations/op -7.7%
to -8.1%.
@skhaz
skhaz marked this pull request as ready for review October 7, 2026 20:29
@skhaz
skhaz requested a review from wolfy-j October 7, 2026 20:29
skhaz and others added 4 commits October 7, 2026 18:45
Keep actor, relay, tool-round and runner fixes; remove the unpublished benchmark API and workloads. Merge current master without changing its teardown semantics. Require explicit live-test opt-in and exercise the actual Lua flag expressions and runner teardown in CI.
@wolfy-j wolfy-j changed the title test: cover Lua runtime controls and message delivery fix: harden Lua actor, relay, tool-round and runner behavior Oct 12, 2026
Cover valid, inflated and undercounted restored counters without changing upgrade payloads. Align the verification harness with CI’s Go 1.26 baseline; the same race and vet checks pass on Go 1.26.5.
@wolfy-j
wolfy-j merged commit d4607bb into master Oct 12, 2026
25 checks passed
@wolfy-j
wolfy-j deleted the test/lua-runtime-coverage-20261007 branch October 12, 2026 18:22
@wippy-releases wippy-releases Bot mentioned this pull request Oct 12, 2026
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.

2 participants