Commit Graph

6959 Commits

Author SHA1 Message Date
JayMishra-github 47f8c9209f test: add tests for extraArgs filtering logic
Address review feedback: add tests covering empty strings,
non-strings, mixed arrays, and non-array inputs for extraArgs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:52:42 +01:00
JayMishra-github cc3c25e413 fix: apply oxfmt 0.32.0 formatting (match CI version)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:52:42 +01:00
JayMishra-github 2977f7325d fix: add extraArgs to sandbox browser config and apply oxfmt formatting
Add the missing extraArgs property to buildSandboxBrowserResolvedConfig
to satisfy the ResolvedBrowserConfig type, and fix import ordering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:52:42 +01:00
JayMishra-github 039fc1e04c feat(browser): add extraArgs config for custom Chrome launch arguments
Adds a `browser.extraArgs` config option (string array) that is appended
to Chrome's launch arguments. This enables users to add stealth flags,
window size overrides, custom user-agent strings, or other Chrome flags
without patching the source code.

Example config:
  browser.extraArgs: ["--window-size=1920,1080", "--disable-infobars"]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:52:42 +01:00
Marcus Widing de900bace8 fix: reset announceRetryCount in replaceSubagentRunAfterSteer
Address review feedback: the spread operator carries stale retry state
into replacement runs, potentially causing immediate force-expiration
without ever attempting announce delivery.
2026-02-16 23:52:39 +01:00
Marcus Widing a6c741eb46 fix(announce): break infinite retry loop with max attempts and expiry (#18264)
When runSubagentAnnounceFlow returns false (deferred), finalizeSubagentCleanup
resets cleanupHandled=false and removes from resumedRuns, allowing
retryDeferredCompletedAnnounces to pick it up again. If the underlying
condition persists (stale registry data, transient state), this creates an
infinite loop delivering 100+ announces over hours.

Fix:
- Add announceRetryCount + lastAnnounceRetryAt to SubagentRunRecord
- finalizeSubagentCleanup: after MAX_ANNOUNCE_RETRY_COUNT (3) failed attempts
  or ANNOUNCE_EXPIRY_MS (5 min) since endedAt, mark as completed and stop
- resumeSubagentRun: skip entries that have exhausted retries or expired
- retryDeferredCompletedAnnounces: force-expire stale entries
2026-02-16 23:52:39 +01:00
Zaf (via OpenClaw) 34b18ea9db fix: respect OPENCLAW_HOME for isolated gateway instances
When OPENCLAW_HOME is set (indicating an isolated instance), the gateway
port should be read from config rather than inheriting OPENCLAW_GATEWAY_PORT
from a parent process. This fixes running multiple OpenClaw instances
where a child process would incorrectly use the parent's port.

Changes:
- resolveGatewayPort() now prioritizes config.gateway.port when OPENCLAW_HOME is set
- Added getConfigPath() function for runtime-evaluated config path
- Deprecated CONFIG_PATH constant with warning about module-load-time evaluation
- Updated gateway run command to use getConfigPath() instead of CONFIG_PATH

Fixes the issue where spawning a sandbox OpenClaw instance from within
another OpenClaw process would fail because OPENCLAW_GATEWAY_PORT from
the parent (set in server.impl.ts) would override the child's config.
2026-02-16 23:52:16 +01:00
Yash 59e0e7e4ff Onboarding: fix webchat URL loopback and canonical session 2026-02-16 23:52:00 +01:00
Yaroslav Boiko a02bcb3620 fix(test): add missing media dedup state fields to mock contexts
Pre-existing test mocks lacked pendingMessagingMediaUrls and
messagingToolSentMediaUrls fields added by the media dedup feature,
causing runtime errors in handleToolExecutionEnd.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:51 +01:00
Yaroslav Boiko 838259331f fix(discord): add media dedup production code for messaging tool pipeline
Wire media URL tracking through the embedded agent pipeline so that
media already sent via messaging tools is not delivered again by the
reply dispatcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:51 +01:00
Yaroslav Boiko c7681c3cff test(media-dedup): add missing coverage for Discord media dedup wiring
Cover three integration points where media dedup could silently regress:
- trimMessagingToolSent FIFO cap at 200 entries
- buildReplyPayloads media filter wiring (new test file)
- followup-runner messagingToolSentMediaUrls filtering
2026-02-16 23:51:51 +01:00
El-Fitz 4640999e77 test: add per-account action gating tests for Discord and Telegram handlers 2026-02-16 23:51:47 +01:00
El-Fitz a03fec2a3f fix: use per-account action config for Discord and Telegram gating
listActions now unions gates across all enabled accounts (matching the
Signal pattern), and handleDiscordAction/handleTelegramAction resolve
through the per-account merged config instead of reading only the
top-level channel actions object.  This lets account-specific
moderation/sticker/presence overrides take effect at both listing and
execution time.
2026-02-16 23:51:47 +01:00
Colin 1faf8e8e9d Slack: add external select flow for large arg menus 2026-02-16 23:51:44 +01:00
Colin 7a4efbb030 Slack: capture workflow button interaction metadata 2026-02-16 23:51:44 +01:00
Colin bd20c1e24d Slack: include stacked modal lifecycle context 2026-02-16 23:51:44 +01:00
Colin ce973332f6 Slack: add media block fallback text handling 2026-02-16 23:51:44 +01:00
Colin 7aaf1547df Slack: escape mrkdwn in interaction confirmations 2026-02-16 23:51:44 +01:00
Colin a7c1b8aea7 Slack: attribute interaction confirmations and structured selects 2026-02-16 23:51:44 +01:00
Colin 9fcb93dd13 Slack: add rich text previews for modal inputs 2026-02-16 23:51:44 +01:00
Colin 05ab147081 Slack: expand advanced modal controls payloads and confirms 2026-02-16 23:51:44 +01:00
Colin 5bbbc3e3e6 Slack: show picker values in interaction confirmations 2026-02-16 23:51:44 +01:00
Colin 5f9a04604e Slack: add header and context blocks to arg menus 2026-02-16 23:51:44 +01:00
Colin 7c5529a153 Slack: enrich modal input payload normalization 2026-02-16 23:51:44 +01:00
Colin d1aa2323bd Slack: update action rows for select interactions 2026-02-16 23:51:44 +01:00
Colin 1bfdd4e237 Slack: add overflow menus for slash arg choices 2026-02-16 23:51:44 +01:00
Colin 296ba8e934 Slack: enrich block action context payloads 2026-02-16 23:51:44 +01:00
Colin 7e42408ade Slack: dedupe normalized interaction selections 2026-02-16 23:51:44 +01:00
Colin 6e790303df Slack: validate runtime blocks in send and edit paths 2026-02-16 23:51:44 +01:00
Colin c01c6b7079 Slack: expand interaction payload normalization coverage 2026-02-16 23:51:44 +01:00
Colin ac969e602c Slack: add modal private metadata utilities 2026-02-16 23:51:44 +01:00
Colin 82d132f1ba Slack: add send blocks behavior tests 2026-02-16 23:51:44 +01:00
Colin e8a1d4171d Slack: guard select option value length in slash menus 2026-02-16 23:51:44 +01:00
Colin c943ffab7c Slack: reject blocks plus media in send paths 2026-02-16 23:51:44 +01:00
Colin 10d876e319 Slack: validate blocks input shape centrally 2026-02-16 23:51:44 +01:00
Colin e023c84d78 Slack: infer interaction channel type from channel ID 2026-02-16 23:51:44 +01:00
Colin 378e18b75b Slack: support blocks in plugin edit action 2026-02-16 23:51:44 +01:00
Colin 3912a2264b Slack: support blocks in plugin send action 2026-02-16 23:51:44 +01:00
Colin 08bc1dce6a Slack: support Block Kit blocks in editMessage 2026-02-16 23:51:44 +01:00
Colin c9684a2678 Slack: support Block Kit blocks in sendMessage actions 2026-02-16 23:51:44 +01:00
Colin bd17587b2a Slack: route modal interactions via private metadata 2026-02-16 23:51:44 +01:00
Colin d57cbcf713 Slack: use static_select for large slash arg menus 2026-02-16 23:51:44 +01:00
Colin cf0ca47a82 Slack: capture Block Kit view closed events 2026-02-16 23:51:44 +01:00
Colin e7cded82b2 Slack: capture Block Kit modal submissions 2026-02-16 23:51:44 +01:00
Colin 21ba564fb0 Slack: fix CI typing for interaction handler 2026-02-16 23:51:44 +01:00
Colin 55b70aa8b4 Slack: register interaction event handler 2026-02-16 23:51:44 +01:00
Colin 9419d029c9 Slack: enrich Block Kit interaction events 2026-02-16 23:51:44 +01:00
Sean McLellan 06b961b037 fix: flatten remaining anyOf/oneOf in Gemini schema cleaning
The Cloud Code Assist API rejects anyOf/oneOf in tool schemas, not just
unsupported keywords. The image tool (index 21) had:
  image: { anyOf: [{ type: "string" }, { type: "array" }] }
which caused "JSON schema is invalid" errors when forwarded to Anthropic
via google-antigravity.

simplifyUnionVariants only handles literal unions and single non-null
variants. This adds a fallback in cleanSchemaForGeminiWithDefs that
flattens any remaining anyOf/oneOf to a simple type schema.

Also reverts the previous provider-aware normalizeToolParameters and
sanitizeToolsForGoogle changes, which were incorrect — the cleaning IS
needed for Google's API regardless of which downstream model is used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00
Sean McLellan 1bbf6206d5 fix: exclude google-antigravity from Gemini schema sanitization
google-antigravity serves Anthropic models (e.g. claude-opus-4-6-thinking),
not Gemini. sanitizeToolsForGoogle was stripping JSON Schema keywords
(minimum, maximum, format, etc.) needed for Anthropic's draft 2020-12
compliance, causing "JSON schema is invalid" rejections on tool 21
(web_search).

This was the actual root cause — the earlier normalizeToolParameters
fix was being overridden by this second sanitization pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00
Sean McLellan fe94e83f6b fix: make tool schema normalization provider-aware
The cleanSchemaForGemini function was being applied universally to all
tools for all providers, stripping out valid JSON Schema keywords like
minimum/maximum that are required by Anthropic's draft 2020-12 validation.

This caused the 21st tool (web_search) to fail with google-antigravity
because its count parameter's constraints were being removed.

Changes:
- Modified normalizeToolParameters to accept modelProvider option
- Only apply Gemini-specific cleaning when provider is Gemini/Google
- Skip aggressive cleaning for Anthropic/google-antigravity providers
- Updated call site in createOpenClawCodingTools to pass modelProvider

Fixes schema validation errors for Anthropic models served via google-antigravity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00