Commit Graph

1079 Commits

Author SHA1 Message Date
Benjamin Jesuiter 01fcac0726 Configure: make model picker allowlist searchable 2026-02-17 09:15:55 +01:00
cpojer 6264c5e842
chore: Fix types in tests 41/N. 2026-02-17 15:50:07 +09:00
cpojer ecf1c955a1
chore: Fix types in tests 29/N. 2026-02-17 14:32:43 +09:00
cpojer d0cb8c19b2
chore: wtf. 2026-02-17 13:36:48 +09:00
Sebastian ed11e93cf2 chore(format) 2026-02-16 23:20:16 -05:00
Sebastian 4b40bdb98e fix(telegram): clear offsets on token change 2026-02-16 23:07:26 -05:00
Sebastian 1486eb66fd revert(gateway): restore loopback auth setup 2026-02-16 22:35:27 -05:00
Sebastian 52b624ccae fix(doctor): audit env-only gateway tokens 2026-02-16 22:35:27 -05:00
cpojer 245018fd6b
chore: Fix types in tests 21/N. 2026-02-17 12:23:12 +09:00
Sebastian 68634468f5 chore(format): fix test import order 2026-02-16 22:18:03 -05:00
Sebastian d137f33281 test(status): cover token summary variants 2026-02-16 22:10:07 -05:00
cpojer 7bc783cb03
chore: Fix types in tests 16/N. 2026-02-17 12:00:29 +09:00
cpojer 9c5f08244e
chore: Format files. 2026-02-17 11:37:11 +09:00
Sebastian f7e75d2c5c fix(doctor): repair googlechat open dm wildcard auto-fix 2026-02-16 21:25:35 -05:00
cpojer 4b8f53979e
chore: Fix type errors from reverts. 2026-02-17 11:22:49 +09:00
cpojer 058eb85762
chore: Fix types in tests 10/N. 2026-02-17 11:22:49 +09:00
Sebastian 0aa28c71ca fix(doctor): move forced exit to top-level command 2026-02-16 21:20:05 -05:00
Sebastian ce4b4d947c revert(doctor): undo accidental merge of PR #18591 2026-02-16 21:09:49 -05:00
Sebastian 4ca75bed56 fix(models): sync auth-profiles before availability checks 2026-02-16 21:00:59 -05:00
cpojer 01ea808876
chore: Format files. 2026-02-17 10:57:31 +09:00
cpojer 003d6c45d6
chore: Fix types in tests 6/N. 2026-02-17 10:57:31 +09:00
Gustavo Madeira Santana 0d1eceb9cf Revert "Onboarding: fix webchat URL loopback and canonical session"
This reverts commit 59e0e7e4ff.
2026-02-16 20:30:03 -05:00
cpojer c70597daeb
chore: Fix formatting. 2026-02-17 09:40:00 +09:00
Peter Steinberger dee0134269 style: reformat dedupe-touched files 2026-02-17 00:32:34 +00:00
Peter Steinberger ed74f48bd5 refactor(status): share update channel display + one-liner 2026-02-17 00:32:34 +00:00
cpojer 90ef2d6bdf
chore: Update formatting. 2026-02-17 09:18:40 +09:00
Peter Steinberger 32e2c369d7 refactor(agents): extract shared session dir resolver 2026-02-16 23:48:43 +00:00
Peter Steinberger 9f0fc74d10 refactor(model): share normalized provider map lookups 2026-02-16 23:00:32 +00:00
OpenClaw Bot 068260bbea fix: add api-version query param for Azure verification 2026-02-17 00:00:08 +01:00
OpenClaw Bot 960cc11513 fix: add Azure AI Foundry URL support for custom providers
Detects Azure AI Foundry URLs (services.ai.azure.com and
openai.azure.com) and transforms them to include the proper
deployment path (/openai/deployments/<model-id>) required by
Azure's API. This fixes the 400 error when configuring OpenAI
models from Azure AI Foundry.

Fixes openclaw/openclaw#17992
2026-02-17 00:00:08 +01:00
Vishal Doshi e91a5b0216 fix: release stale session locks and add watchdog for hung API calls (#18060)
When a model API call hangs indefinitely (e.g. Anthropic quota exceeded
mid-call), the gateway acquires a session .jsonl.lock but the promise
never resolves, so the try/finally block never reaches release(). Since
the owning PID is the gateway itself, stale detection cannot help —
isPidAlive() always returns true.

This commit adds four layers of defense:

1. **In-process lock watchdog** (session-write-lock.ts)
   - Track acquiredAt timestamp on each held lock
   - 60-second interval timer checks all held locks
   - Auto-releases any lock held longer than maxHoldMs (default 5 min)
   - Catches the hung-API-call case that try/finally cannot

2. **Gateway startup cleanup** (server-startup.ts)
   - On boot, scan all agent session directories for *.jsonl.lock files
   - Remove locks with dead PIDs or older than staleMs (30 min)
   - Log each cleaned lock for diagnostics

3. **openclaw doctor stale lock detection** (doctor-session-locks.ts)
   - New health check scans for .jsonl.lock files
   - Reports PID status and age of each lock found
   - In --fix mode, removes stale locks automatically

4. **Transcript error entry on API failure** (attempt.ts)
   - When promptError is set, write an error marker to the session
     transcript before releasing the lock
   - Preserves conversation history even on model API failures

Closes #18060
2026-02-16 23:59:22 +01:00
Peter Steinberger 486b7379d4 refactor(test): dedupe doctor harness mock payload factories 2026-02-16 22:55:59 +00:00
Echo 1dfacd4dd1 fix(status): avoid bot+app token warning for mattermost 2026-02-16 23:55:56 +01:00
Mitsuyuki Osabe afd354c482 fix: add catalog validation to `models set` command
`models set` accepts any syntactically valid model ID without checking
the catalog, allowing typos to silently persist in config and fail at
runtime. It also unconditionally adds an empty `{}` entry to
`agents.defaults.models`, bypassing any provider routing constraints.

This commit:
- Validates the model ID against the catalog (skipped when catalog is
  empty during initial setup)
- Warns when a new entry is added with empty config (no provider routing)

Closes openclaw/openclaw#17183

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
2026-02-16 23:54:52 +01:00
Knox 9aa8db5c81 fix(doctor,configure): skip gateway auth for loopback-only setups 2026-02-16 23:53:11 +01:00
yinghaosang 6757a9fedc fix(telegram): clean up update offset on channels remove --delete (#18233) 2026-02-16 23:53:06 +01:00
Yash 59e0e7e4ff Onboarding: fix webchat URL loopback and canonical session 2026-02-16 23:52:00 +01:00
norunners d799a3994f fix(doctor): reconcile gateway service token drift after re-pair
`openclaw doctor` audited gateway service runtime/path settings but did not
check whether the daemon's `OPENCLAW_GATEWAY_TOKEN` matched
`gateway.auth.token` in `openclaw.json`.

After re-pairing or token rotation, the config token and service env token can
drift. The daemon may keep running with a stale service token, leading to
unauthorized handshake failures for cron/tool clients.

Add a gateway service audit check for token drift and pass
`cfg.gateway.auth.token` into service audits so doctor treats config as the
source of truth when deciding whether to reinstall the service.

Key design decisions:
- Use `gateway.auth.token` from `openclaw.json` as the authority for service
  token drift detection
- Only flag mismatch when an authoritative config token exists
- Keep fix in existing doctor service-repair flow (no separate migration step)
- Add focused tests for both audit mismatch behavior and doctor wiring

Fixes #18175
2026-02-16 23:51:16 +01:00
gitwithuli c89eb351ea style: run oxfmt formatting on doctor-config-flow.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
gitwithuli 304bfefaf9 chore: remove unused channelName parameter from ensureWildcard
Addresses review feedback — channelName was declared but only
prefix was used for change messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
gitwithuli b05273de61 fix: doctor --fix auto-repairs dmPolicy="open" missing allowFrom wildcard
When a channel is configured with dmPolicy="open" but without
allowFrom: ["*"], the gateway rejects the config and exits.
The error message suggests running "openclaw doctor --fix", but
the doctor had no repair logic for this case.

This adds a repair step that automatically adds "*" to allowFrom
(or creates it) when dmPolicy="open" is set without the required
wildcard. Handles both top-level and nested dm.allowFrom, as well
as per-account configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
gleb 78c34bcf33 Add runtime quiting functionality to doctor.ts 2026-02-16 23:50:37 +01:00
gleb 2540417170 Add to exit process when doctor has finished 2026-02-16 23:50:37 +01:00
OpenClaw Agent 0af795287a Fix: Doctor refers to deprecated auth command
Replaces deprecated 'openclaw auth add --provider' with
'openclaw configure --section provider' in doctor-memory-search.ts

Closes #18535
2026-02-16 23:50:11 +01:00
Peter Steinberger af5d4ac7d3 refactor(test): dedupe doctor legacy migration fixtures 2026-02-16 22:47:26 +00:00
Peter Steinberger 9372df45f2 refactor(test): table-drive auth choice option checks 2026-02-16 18:25:04 +00:00
Shadow 1b7301051b
Config: require Discord ID strings (#18220) 2026-02-16 12:22:58 -06:00
Peter Steinberger 5b185da366 refactor(test): remove remaining command test duplication 2026-02-16 16:52:53 +00:00
Peter Steinberger 0d51869c3c refactor(test): consolidate doctor health and sandbox fixtures 2026-02-16 16:48:55 +00:00
Peter Steinberger 2d8edf85ad refactor(test): share onboarding and model auth test helpers 2026-02-16 16:48:55 +00:00