mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-09 03:22:40 +00:00
perf(phone-control): use startup config for expiry guard
This commit is contained in:
@@ -369,7 +369,7 @@ describe("phone-control plugin", () => {
|
||||
}
|
||||
|
||||
await service.start({
|
||||
config: {},
|
||||
config: createPhoneControlConfig(),
|
||||
stateDir,
|
||||
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
||||
});
|
||||
@@ -381,7 +381,7 @@ describe("phone-control plugin", () => {
|
||||
expect(lookup).toHaveBeenCalledWith("current");
|
||||
|
||||
await service.stop?.({
|
||||
config: {},
|
||||
config: createPhoneControlConfig(),
|
||||
stateDir,
|
||||
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
||||
});
|
||||
@@ -439,7 +439,7 @@ describe("phone-control plugin", () => {
|
||||
}
|
||||
|
||||
await service.start({
|
||||
config: {},
|
||||
config,
|
||||
stateDir,
|
||||
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
||||
});
|
||||
@@ -454,7 +454,7 @@ describe("phone-control plugin", () => {
|
||||
});
|
||||
|
||||
await service.stop?.({
|
||||
config: {},
|
||||
config,
|
||||
stateDir,
|
||||
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
||||
});
|
||||
|
||||
@@ -300,7 +300,7 @@ export default definePluginEntry({
|
||||
|
||||
const timerService: OpenClawPluginService = {
|
||||
id: "phone-control-expiry",
|
||||
start: async () => {
|
||||
start: async (ctx) => {
|
||||
const tick = async () => {
|
||||
const state = await readArmState(api);
|
||||
if (!state || state.expiresAtMs == null) {
|
||||
@@ -320,7 +320,7 @@ export default definePluginEntry({
|
||||
}, 15_000);
|
||||
expiryInterval.unref?.();
|
||||
|
||||
if (hasPhoneControlAllowOverride(api.runtime.config.current())) {
|
||||
if (hasPhoneControlAllowOverride(ctx.config)) {
|
||||
// Active dangerous command allows must be reconciled before gateway
|
||||
// readiness; otherwise an expired phone-control window can survive.
|
||||
await tick().catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user