openclaw/src/talk
Peter Steinberger 444f09ee66
fix(test): await Talk storage cleanup before removing fixtures
Synchronous database close revokes registered SQLite workers without
joining native shutdown. Archive/mutation worker cleanup can still update
shared-state leases and integrity records while a fixture recursively
removes its root. A Linux syscall trace caught creation of the quarantine
store's rollback journal after recursive removal began.

Main 4df14ffdaf already fixed the original
Gateway Talk client fixture. Extend the same root-scoped async cleanup to
five Talk fixtures that perform real session/transcript writes. Drain
writers and native workers before restoring the environment and removing
their directories. Keep the existing assertions and runtime contracts.

F103 sightings:
- main run 35762705759, job 106869378669 (409f0a9599)
- main run 35763334923, job 106869114339 (160c474f43)

The controlled Linux baseline used the original fixture from 409f0a959 on
ab4c2cd058, then restored its already-landed
fix without changing runtime code or dependencies. Two-CPU affinity,
OPENCLAW_VITEST_MAX_WORKERS=8, and one CPU pressure process reproduced
ENOTEMPTY in 3/20 standalone runs and in shuffled order (seed 103).
All three original 89-file shard replays passed on the baseline.

Focused proof: 58 tests in the five changed fixtures, 618 Gateway Talk
tests, and 3 shared cleanup-owner tests passed. check-changed, explicit
type-aware oxlint, a rejecting no-floating-promises canary, formatting,
and diff whitespace checks passed. P2 autoreview was clean.

Measured pnpm test <file> --maxWorkers=1 wall times:
- agent-consult-runtime.test.ts: 14.47s
- client-voice-session.test.ts: 28.51s
- client-voice-session.startup.test.ts: 14.88s
- client-voice-session.digest-retry.test.ts: 20.61s
- voice-consult-transcript-race.test.ts: 52.01s
The last file's Vitest time was 41.85s: 73% transform, 16% tests, and 10%
imports. Its six existing cases require real SQLite transcript admission
and shutdown; this change adds no test cases.

After restoring the landed cleanup: 0/20 standalone failures, shuffled
order passed, and all 3 original shard replays passed. The shard executor
applied its native two-worker fallback on the two-CPU affinity set.
Blacksmith Testbox tbx_01m35765njxybxzy9rzn9tpbaz:
https://github.com/openclaw/openclaw/actions/runs/35769683627

Standalone command (20 samples plus shuffled seed 103 per variant):
OPENCLAW_VITEST_MAX_WORKERS=8 node scripts/run-vitest.mjs --config test/vitest/vitest.gateway-client.config.ts src/gateway/talk/handlers/client.test.ts
Shard command (original agentic-gateway-core-2-hosted-2 descriptor):
node --import tsx scripts/ci-run-node-test-shard.mts
2026-09-22 12:58:12 -07:00
..
activation-name.test.ts
activation-name.ts
agent-consult-runtime.storage.test.ts fix: keep Talk answers matched to their live runs (#153140) 2026-09-19 21:54:38 +01:00
agent-consult-runtime.test.ts fix(test): await Talk storage cleanup before removing fixtures 2026-09-22 12:58:12 -07:00
agent-consult-runtime.ts improve: reduce session delivery reader imports (#154740) 2026-09-21 04:26:04 -07:00
agent-consult-tool.test.ts
agent-consult-tool.ts
agent-run-control-owner.ts fix(discord): prevent voice playback gaps and stale turn controls (#146798) 2026-09-13 04:11:01 -07:00
agent-run-control-shared.ts
agent-run-control.runtime.ts
agent-run-control.test.ts fix(discord): prevent voice playback gaps and stale turn controls (#146798) 2026-09-13 04:11:01 -07:00
agent-run-control.ts fix: hide internal prompts when Talk steers an active run (#153698) 2026-09-20 15:30:31 +01:00
agent-talkback-runtime.test.ts
agent-talkback-runtime.ts
agent-target.test.ts
agent-target.ts
audio-codec.test.ts
audio-codec.ts improve(talk): reduce voice resampling CPU work (#146469) 2026-09-12 14:37:28 -07:00
audio-energy.test.ts
audio-energy.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
audio-output-port.test.ts fix(voice): keep audio flowing while the Gateway is busy (#154119) 2026-09-20 21:49:35 -07:00
audio-output-port.ts fix(voice): keep audio flowing while the Gateway is busy (#154119) 2026-09-20 21:49:35 -07:00
client-voice-confirmation-lifecycle.test.ts
client-voice-confirmation-policy.ts
client-voice-confirmation-readiness.ts
client-voice-confirmation-transcript.test.ts
client-voice-confirmation.test-support.ts
client-voice-confirmation.test.ts
client-voice-confirmation.ts
client-voice-mutation-digest-owner.test.ts
client-voice-mutation-digest-owner.ts
client-voice-session-store.test.ts
client-voice-session-store.ts
client-voice-session.digest-retry.test.ts fix(test): await Talk storage cleanup before removing fixtures 2026-09-22 12:58:12 -07:00
client-voice-session.fixture.test-support.ts test: share voice-session fixture helpers (#154085) 2026-09-20 14:26:40 -07:00
client-voice-session.startup.test.ts fix(test): await Talk storage cleanup before removing fixtures 2026-09-22 12:58:12 -07:00
client-voice-session.test-support.ts
client-voice-session.test.ts fix(test): await Talk storage cleanup before removing fixtures 2026-09-22 12:58:12 -07:00
client-voice-session.ts
consult-question.test.ts
consult-question.ts
consult-transcript.test.ts
consult-transcript.ts
describe-view-tool.ts
diagnostics.test.ts
diagnostics.ts
event-metrics.ts
exact-speech-protocol.test.ts
exact-speech-protocol.ts
fast-context-runtime.test.ts
fast-context-runtime.ts
forced-consult-coordinator.test.ts
forced-consult-coordinator.ts
logging.test.ts fix(telegram): control commands get stuck behind active conversations (#153829) 2026-09-21 21:22:47 -04:00
logging.ts
observability.ts
output-activity-tracker.test.ts
output-activity-tracker.ts
provider-discovery.test-fixtures.ts
provider-internal.ts
provider-registry.ts
provider-resolver.discovery.test.ts
provider-resolver.test.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
provider-resolver.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
provider-types.ts fix(voice): keep audio flowing while the Gateway is busy (#154119) 2026-09-20 21:49:35 -07:00
realtime-session-harness.test.ts test: reuse provider fixtures in the Talk harness (#154142) 2026-09-20 16:36:58 -07:00
realtime-session-harness.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
realtime-session-lifecycle.ts refactor(voice): consolidate lifecycle and handoff ownership (#149865) 2026-09-16 02:16:29 -07:00
realtime-session-policy.test.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
realtime-session-policy.ts feat(voice): share GPT Live across meetings and calls (#146546) 2026-09-12 17:06:51 -07:00
realtime-voice-lazy-lifecycle.ts refactor(voice): consolidate lifecycle and handoff ownership (#149865) 2026-09-16 02:16:29 -07:00
session-log-runtime.test.ts
session-log-runtime.ts
session-runtime.close.test.ts test: share Talk provider fixture construction (#154099) 2026-09-20 15:30:43 -07:00
session-runtime.native.test.ts
session-runtime.test-support.ts test: share Talk provider fixture construction (#154099) 2026-09-20 15:30:43 -07:00
session-runtime.test.ts test: share Talk provider fixture construction (#154099) 2026-09-20 15:30:43 -07:00
session-runtime.ts feat: switch voices during Talk and Discord calls (#146676) 2026-09-15 21:01:36 -07:00
talk-events.test.ts
talk-events.ts
talk-session-controller.test.ts
talk-session-controller.ts
turn-context-tracker.test.ts
turn-context-tracker.ts
voice-consult-transcript-race.test.ts fix(test): await Talk storage cleanup before removing fixtures 2026-09-22 12:58:12 -07:00
voice-selection-control.ts feat: switch voices during Talk and Discord calls (#146676) 2026-09-15 21:01:36 -07:00
voice-transcript.test.ts
voice-transcript.ts