Skip to content

Bump actions/setup-go from 6.2.0 to 6.4.0#106

Closed
dependabot[bot] wants to merge 859 commits into
mainfrom
dependabot/github_actions/actions/setup-go-6.4.0
Closed

Bump actions/setup-go from 6.2.0 to 6.4.0#106
dependabot[bot] wants to merge 859 commits into
mainfrom
dependabot/github_actions/actions/setup-go-6.4.0

Conversation

@dependabot
Copy link
Copy Markdown

@dependabot dependabot Bot commented on behalf of github May 8, 2026

Bumps actions/setup-go from 6.2.0 to 6.4.0.

Release notes

Sourced from actions/setup-go's releases.

v6.4.0

What's Changed

Enhancement

Dependency update

Documentation update

New Contributors

Full Changelog: actions/setup-go@v6...v6.4.0

v6.3.0

What's Changed

Full Changelog: actions/setup-go@v6...v6.3.0

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

batuhan and others added 22 commits March 26, 2026 01:30
Extract three shared helpers to reduce code duplication:

- syncSingleSession: unifies session sync logic from syncSessions and
  handleSessionEvent (hadRoom check, ensurePortal, queueResync)
- resolveArtifactFields: extracts artifact field resolution (URL, title,
  mediaType with fallbacks) shared by streaming and canonical backfill
- defaultPortalLifecycleOptions: consolidates identical PortalLifecycleOptions
  construction used by ensureOpenCodeSessionPortalWithRoom and
  createManagedLauncherChat

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract applyOpenClawSessionMetadata (5 call sites), consolidate seq-extraction,
replace clone-via-JSON with jsonutil.DeepCloneMap, extract parsedTokenUsage,
unify URL normalization pair, and extract supportsFeature helper. ~34 lines removed.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create pkg/shared/globmatch with Pattern, Compile, CompileAll, MatchesAny,
and MakePredicate. Both pkg/agents/toolpolicy and pkg/runtime now use the
shared package instead of their own compiledPattern implementations. ~121 lines removed.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract shared abstractions to reduce code duplication:

- 6a: Extract fetchHistoryRows + loadHistoryMessages to share the
  history-loading pipeline between buildBaseContext and
  buildContextUpToMessage.
- 6b: Extract prepareInboundPromptContext + inboundPromptResult to
  share the inbound preamble setup between buildContextWithLinkContext
  and buildContextWithMedia.
- 6c: Replace validateModel's manual iteration with a delegation to
  resolveModelID, which already performs the same steps.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Apply formatting-only changes: reorder and tidy imports in pkg/runtime/pruning.go (place openai import before globmatch and add spacing) and normalize spacing/alignment of fields in MessageSchema in pkg/shared/toolspec/toolspec.go. These are whitespace/style adjustments only and introduce no functional changes.
Introduce a common crypto backend resolver and maubuild wrapper, and update scripts/manifests to use them. Added tools/lib/crypto_backend.sh to select a Go build tag based on AGENTREMOTE_CRYPTO_BACKEND (default: goolm) and tools/maubuild which forwards the tag to `go tool maubuild`. Agent entrypoints (agentremote.sh, tools/bridges) now source the resolver and support AGENTREMOTE_GO_TAG; build.sh and bridges.manifest were updated to call ./tools/maubuild. Documentation updated to show the tagged invocation and the AGENTREMOTE_CRYPTO_BACKEND note. Also removed olm packages from the Docker image, added /dummybridge to .gitignore, and made minor robustness fixes (set -eu and cd to script dirs).
* Remove Beeper provider and refactor MagicProxy support

Remove Beeper-specific codepaths and managed Beeper auth, and consolidate OpenRouter-compatible handling around Magic Proxy. Updates include: removing Beeper from login flows, login logic, managed beeper reconciliation, model defaults, image generation routing, and provider slug/id helpers; treating Magic Proxy as the OpenRouter-compatible provider in capability checks; adding a resolvePortalSenderAndIntent helper and using it for ensuring joined intents/senders; and simplifying preferred-login selection to prefer Magic Proxy logins. Tests were updated to reflect the removal of Beeper and to cover the new intent resolution behaviour and sender selection.

* remove old code

* sync

* Update profile.go
…stem events going from agent ghosy (#91)

* fixes

* sync

* sync

* Update metadata.go

* heartbeat should only spawn if there is an agent that needs it

* Use agent map and clarify agent commands

Refactor agent handling to preload agents and simplify scheduling logic: load agents into a map (LoadAgents) and use it to check existence, remove the agentsEnabled gating and extra portals parameter from resolveSchedulableHeartbeatAgents, and simplify its signature. Replace ad-hoc error strings with agentChatsDisabledError() in chat resolution paths for consistent error handling. Change parseAgentsCommandArgs so a bare invocation reports the current enabled/disabled status instead of toggling state. Update unit tests accordingly to match the new behaviors.

* Revert Agents setting on save failure

If client.UserLogin.Save fails when toggling AI agents, restore the previous loginMeta.Agents value. The change stores the prior Agents pointer in prev and reverts it on save error to avoid leaving in-memory state inconsistent when persistence fails.

* Disable agents by default; refactor scheduling

Change default agent enablement to false when login/metadata are missing and tighten checks in AI client (agentsEnabledForLogin/agentsEnabled). Refactor scheduler heartbeat logic: replace resolveSchedulableHeartbeatAgents with schedulableHeartbeatAgents which verifies configured candidates against the agent store and ensures agents have at least one user-facing chat (agentHasUserChat). Remove orphan-room cleanup path and related helpers, and update tests to cover user-chat detection (internal/subagent portals are ignored). These changes prevent scheduling when agent metadata is absent and simplify heartbeat agent resolution.

* Send system notices using bridge bot

Change sendSystemNotice to send notices via the bridge bot (UserLogin.Bridge.Bot.SendMessage) instead of the portal pipeline. Add nil checks for oc and its login/bridge/bot chain before sending. Update test helper to capture sent room, event type and content and return a RespSendEvent, and add TestSendSystemNoticeUsesBridgeBot to verify the bot is used and the notice content/msgtype are preserved.

* Split heartbeat agent filters and add tests

Refactor heartbeat agent selection: schedulableHeartbeatAgents no longer requires listing chat portals and only filters by agent store; added schedulableHeartbeatAgentsWithUserChats to apply the user-chat portal filter used by reconcile. Introduced wakeableHeartbeatAgents to keep only agents that currently resolve to a concrete heartbeat session portal, and changed RequestHeartbeatNow to resolve candidates, apply wakeable filtering, and early-return if none are wakeable before loading the heartbeat store. Adjusted log messages and moved the loadHeartbeatStore call after wake filtering. Added tests to ensure schedulableHeartbeatAgents works without bridge portal access and that RequestHeartbeatNow skips agents without a delivery target; also updated a streaming test to use agentModeTestMeta.

* Place canonical final payload in m.new_content

Move canonical assistant fields (com.beeper.ai, link previews, etc.) into m.new_content for final replacement edits and keep only Matrix-edit fallback metadata at the top level. Implemented: buildFinalEditPayload now strips relations and link previews from replacement content and returns Extra (m.new_content) plus TopLevelExtra (edit-only fields). SDK updated with BuildDefaultFinalEditExtra and BuildDefaultFinalEditTopLevelExtra and FinalEditPayload gained an Extra field. BuildConvertedEditWithExtra was added to carry m.new_content through edit conversion and Turn.buildFinalEdit was updated accordingly. Also: prefer m.new_content when parsing existing link previews, add helper existingLinkPreviewsRaw and corresponding tests, add shouldEnsureDefaultChat helper and test, and update docs to describe the new edit shape. Tests adjusted/added to assert the new behavior.

* Inline ConvertedEdit construction and remove helper

Remove the turns.ConvertedEdit helper and inline ConvertedEdit creation where needed. Deleted turns/converted_edit.go and updated sdk/turn.go and approval_flow.go to build bridgev2.ConvertedEdit structs directly (also added a nil check for response.Content in approval_flow.go). This eliminates the turns package helper functions and centralizes the edit construction logic, while preventing nil-content edits.

* Remove deprecated helpers and connector wrapper

Cleanup and refactor: remove several deprecated helpers and a thin connector wrapper, and update tests accordingly.

- Delete pkg/connector/connector.go (removed re-export of AI connector).
- Move snapshotParts helper from bridges/dummybridge/runtime.go into bridges/dummybridge/runtime_test.go and adjust imports.
- Remove StreamSession.pendingCount() and replace test usages with a local pendingPartCount helper in turns/session_target_test.go.
- Remove auth persistence helpers (ResolveFromEnvOrStore, Load, Save) from cmd/internal/beeperauth/auth.go.
- Remove an early nil-check in ApprovalFlow.editPromptToResolvedState so RemoteEdit is queued even when edit is nil.

These changes consolidate test-only utilities into test files, drop unused wrappers, and simplify session/auth code paths.
* Resolve responder metadata across AI bridge

- Add responder resolution for models and agents
- Snapshot context limits and capabilities into streaming and UI metadata
- Update final turn metadata to use resolved responder state

* Use resolved responder data for context limits

- Derive model, provider, capabilities, and sender identity from the resolved responder
- Fall back to provider defaults when responder resolution is unavailable
- Carry the responding ghost and model through streaming metadata

* Restrict model contact identifiers to stable IDs

- Remove display-name and URI aliases from model contact matching
- Add regression test to ensure only canonical identifiers are used

* Normalize AI contact identifiers to canonical forms

- Use `model:` and `agent:` identifiers for lookup and display
- Accept canonical identifiers in resolution paths and catalog search
- Tighten tests around stable identifiers and login-gated agent contacts

* Make responder capability checks context-aware

- Thread ctx through model capability lookups and tool selection
- Simplify agent/model contact identifiers to use stable IDs
- Fold shared responder metadata construction into one helper

* Use model mode for responder metadata snapshots

- resolve model API with a background context
- update tests to exercise model mode metadata
- keep assistant turn metadata formatting consistent

* Ignore benign send errors in AI finalization

- suppress non-critical errors when emitting heartbeat and reasoning messages
- avoid clearing cached AI clients during login reload
- make test image server writes explicit

* Respect context limits in AI responder resolution

- Use room capabilities when building status text
- Resolve responder info with override-aware ghost IDs
- Tighten tool-calling defaults and cover the new cases

* Keep agent identifier resolution working without responder

- Fall back to agent name or ID when display name lookup is empty
- Log responder resolution failures and continue with default user info
- Add regression test for missing responder resolution
* Add DM/config & remote message helpers

Introduce helper utilities for DM portal configuration and pre-built remote messages: ConfigureDMPortal, BuildPreConvertedRemoteMessage, and SendSystemMessage. Extend BuildLoginDMChatInfo/BuildDMChatInfo to accept custom senders, bot UserInfo and member extras. Add ClientBase.SendSystemMessage wrapper and replace numerous ad-hoc portal configuration and send implementations across bridges (ai, codex, openclaw, opencode, dummybridge, opencode removal of portal_send). Update OpenClaw gateway client identifiers and refactor message queuing to use BuildPreConvertedRemoteMessage. Update tests to cover new helpers and timing/ID generation. This centralizes DM/remote message logic, reduces duplication, and standardizes system notice delivery.

* Format: align struct fields and whitespace

Apply non-functional formatting changes: align struct field names and types in DMChatInfoParams and LoginDMChatInfoParams, adjust spacing in BuildDMChatInfo (Membership) and provisioning.go (CanBackfill). No behavioral changes; only whitespace/formatting adjustments.

* Remove unused imports in bridge packages

Clean up imports across multiple bridge packages to address unused-import compile errors and tidy code. Removed unused imports (database, event, networkid) from codex, dummybridge, openclaw, and opencode files; added a missing time import in openclaw/events.go. Changes affect: bridges/codex/client.go, bridges/codex/directory_manager.go, bridges/dummybridge/bridge.go, bridges/openclaw/events.go, bridges/openclaw/provisioning.go, and bridges/opencode/opencode_portal.go.

* Use buildOpenClawDMChatInfo and keep message raw

Rename OpenClaw helper syntheticDMPortalInfo to buildOpenClawDMChatInfo and update its call sites in GetChatInfo and createConfiguredAgentDM for clarity. Also change CodexClient.sendSystemNotice to pass the message through unchanged (remove strings.TrimSpace) so system messages are not altered before sending.

* Use portal sender for system notices and fix SendNotice

Propagate and use a portal-specific EventSender for system notices across Codex and OpenClaw bridges and the SDK. Key changes:

- bridges/codex: delay composeCodexChatInfo until after portal configuration and add background retry send when portal.MXID is not yet set.
- bridges/openclaw: change sendSystemNotice to accept a sender, pass approval-specific sender from manager, and update related calls; tweak provisioning error text.
- helpers.go: return the actual event ID (evt.ID) on errors/success instead of using p.MsgID.
- sdk/client.go: provide senderForPortal to approval flow and use it when sending notices.
- sdk/conversation.go: make Conversation.SendNotice trim input and send via sendMessageContent (uses conversation intent), avoiding direct agentremote call.
- sdk/turn_test.go: add test to verify Conversation.SendNotice uses the conversation intent and records sent message details; expand test matrix API stub to record sent messages.

These changes ensure system notices are sent with the correct sender identity, handle races when a portal's MXID isn't immediately available, and standardize event ID handling and notice delivery paths.

* Update client.go
When determining capabilities for model rooms, mark reply and thread as rejected (CapLevelRejected). Update unit test to reflect the new behavior: rename test, expect reply and thread to be rejected, and assert the serialized room features include reply and thread set to -2. Existing reaction and edit capability expectations remain unchanged.
* Add user stop handling and stop metadata

Refactor and extend abort/stop behavior to support targeted user stops. Introduces userStopRequest/plan/result types and handleUserStop/executeUserStopPlan to resolve and execute room-wide, active-turn, or queued-turn stops. Replaces direct abortRoom calls with handleUserStop in command and message handlers.

Adds assistantStopMetadata and propagates it into streamingState and UI message metadata (including response status mapping). Tracks room run targets (source/initial events) and binds streaming state to room runs. Implements queue operations to drain or remove pending items by source event and finalizes stopped queue items, preserving ACK reaction removal and session notifications. Adjusts streaming finish logic to treat cancelled vs stop reasons appropriately. Includes unit tests for plan resolution, queued removal, and metadata emission.

* Refactor queue checks, abort text, and streaming errors

Move pendingQueueHasSourceEvent into pending_queue.go and implement proper locking (pendingQueuesMu and queue.mu) to safely inspect queue items. Simplify drainPendingQueue to delete the queue map entry and return its items directly. Remove the duplicate helper from abort_helpers.go. Improve formatAbortNotice by capitalizing each sentence part and joining them with ". " for clearer messages. Remove redundant run field assignments in roomRunTarget. Adjust finishStreamingWithFailure to fall through from "cancelled" to "stop" so cancelled streams call End like stop cases and remove some redundant nil checks. These changes tidy concurrency handling, clarify abort messaging, and simplify streaming error handling.

* Make stop metadata atomic and thread-safe

Change streamingState.stop to an atomic.Pointer[assistantStopMetadata] and update all callsites to use .Load()/.Store() to avoid races. Fix pending queue drain to lock the queue when accessing items to prevent concurrent access. Improve room run logic to prefer current state.turn when present and store stop metadata atomically when marking a run stopped. Use utf8 + unicode for correct Unicode-aware capitalization in abort notices and update tests to store stop metadata via the new atomic API.

* Centralize ack removal and simplify queue logic

Move AckReactionRemoveAfter checks into removePendingAckReactions and remove duplicate guarded calls throughout the codebase, so callers simply invoke the removal and the function decides whether to act. Simplify pending queue management by replacing clearPendingQueue usage with drainPendingQueue and delete the pendingQueueHasSourceEvent helper. Adjust stop-plan handling to speculatively return queued stops and add a fallback in executeUserStopPlan to convert a queued plan to no-match if nothing was drained. Update tests to reflect the new speculative behavior and the fallback.

* Update pending_queue.go

* Propagate context to queue/stop ops and refine stop handling

Pass context through pending-queue and subagent stop helpers (clearPendingQueue, stopSubagentRuns, finalizeStoppedQueueItems) and always finalize/drain pending items when clearing queues. Fix executeUserStopPlan logic to mark active stops before cancelling and fall back to a no-match when an active stop is a no-op. Ensure removePendingAckReactions is always invoked in goroutine cleanup. Adjust finishStreamingWithFailure to properly end turns on cancelled streams without falling through, and prefer explicit stop flag in canonicalResponseStatus. Add tests covering the no-op active stop fallback, cancelled finish behavior, and canonicalResponseStatus preference.

* Fix pending queue locking and lastItem updates

Rework pending queue locking and item housekeeping to avoid races and stale pointers. getPendingQueue now locks the queue.mu before releasing pendingQueuesMu and consistently applies settings for both new and existing queues. drainPendingQueue clears queue.items and lastItem when removing a queue. removePendingQueueBySourceEvent reassigns lastItem to the new tail if the removed item was the last. enqueuePendingItem removed a now-redundant explicit lock (the returned queue is already locked). Added a unit test to verify lastItem is cleared/reassigned, and tightened an error assertion in the streaming test to use errors.Is for wrapped cancellations.
* Fit final edit payloads; status info & misc fixes

Add logic to ensure final edit payloads fit within Matrix event size limits by estimating content size and progressively compacting: clear formatted body, drop link previews, compact or drop AI UI metadata, drop other extra fields, and trim body as a last resort. Introduce MaxMatrixEventContentBytes, FitFinalEditPayload, related helpers, fit result logging (used in Turn.buildFinalEdit), and tests for the behavior.

Also add MatrixMessageStatusEventInfo helper to populate/fallback room IDs and use it in message status sending paths (bridges/ai client and handler and SendMatrixMessageStatus), and bump maxAgentLoopToolTurns from 10 to 50. Include new unit tests for status helper and final edit fitting.

* Preserve reasoning/tool parts in final UI payload

Treat reasoning (and tool/artifact) parts as non-duplicate when building the compact final UI message so they can be attached to the final Matrix edit when size allows. Update BuildCompactFinalUIMessage comment and logic to only drop duplicate text (and streaming step-start) parts, and adjust tests to expect reasoning and tool parts to be preserved (rename and extend test to verify presence of reasoning and tool metadata).

* Add agent loop timeout; update final edit fitting

Introduce a 2-minute agent loop wall-clock timeout and helper (withAgentLoopTimeout) used when running agent loops and heartbeats to ensure runs don't hang; update heartbeat logging to include the configured timeout. Replace backgroundContext usage with withAgentLoopTimeout in dispatch and heartbeat execution. In SDK final_edit, switch deep-clone logic to jsonutil.DeepCloneMap, adjust FitFinalEditPayload to return an error alongside the fitted payload and details (and return an error if payload still exceeds Matrix limits after fitting), and update imports accordingly. Changes touch bridges/ai/* and sdk/final_edit.go.

* Reorder imports in sdk/final_edit files

Reorganize import blocks in sdk/final_edit.go and sdk/final_edit_test.go to group third-party packages consistently (maunium.net imports) and maintain gofmt/goimports ordering. No functional changes — only import formatting.

* Fallback to text-only final edits on fit failure

If fitting a FinalEditPayload fails due to size limits, try a text-only fallback (strip Extra/TopLevelExtra) and use that instead; enhance logging with fallback metrics and errors. Fix the binary-search trimming logic in FitFinalEditPayload to operate on the original body (avoids re-trimming an already-trimmed body). Add BuildTextOnlyFinalEditPayload helper and tests covering the binary-search behavior and the fallback path. Also adjust activity timeout timings in agent loop tests to reduce flakiness.

* Preserve parent context in agent loop timeout

Use the caller-provided context when creating the agent loop inactivity timeout instead of oc.backgroundContext(ctx), so parent cancellations propagate to the derived context. Add TestWithAgentLoopInactivityTimeoutPreservesParentCancellation to verify the derived context cancels and reports context.Canceled when the parent is cancelled. Changes in bridges/ai/agent_loop_runtime.go and bridges/ai/agent_loop_test.go.

* Suppress context.Canceled logs; use SDK UI helpers

Silence noisy logging/processing for context.Canceled across AI bridge code by returning early in setModelTyping, savePortalQuiet, and StreamSession.logWarn. Replace local UI helper wrappers with SDK-provided helpers for building compact final UI messages and default final-edit extras, and update tests accordingly. Simplify agent loop finalization by removing the errorExit branching and guarding FinalizeAgentLoop to avoid double-finalization; also remove special-case notification for canceled agent loops. Add a unit test to ensure context.Canceled is suppressed in logWarn and adjust imports where needed.

* Update final_edit_test.go

* Clone Extra and reorder final edit send

Shallow-clone FinalEditPayload.Extra before embedding it into event content to avoid in-place mutation by mautrix's Content.MarshalJSON (which deep-merges Parsed into Raw). Cleaned up the corresponding test to stop inspecting/logging fit details. Also move sendFinalEdit to occur after session.End in Turn.finalizeTurn so the session teardown runs before the final edit is sent; persisting the final message remains unchanged.

* Handle Matrix chat deletion; clear live stream

Add support for Matrix chat deletion cleanup and ensure live-stream descriptors are cleared on final edits.

- Introduce HandleMatrixDeleteChat in bridges/ai/delete_chat.go to best-effort clean up runtime state (drain queues, stop runs/typing, release room), remove persisted session artifacts, forget portal references in login metadata, and notify session mutations.
- Wire up AIClient to implement DeleteChatHandlingNetworkAPI.
- Add clearSystemEventsForSession to bridges/ai/system_events.go to drop in-memory system events for a session.
- In sdk/turn.go, clear the BeeperStream descriptor and com.beeper.stream extras when a session exists so terminal edits don't appear as active streams.
- Add tests in sdk/turn_test.go to verify stream sessions are closed before dispatching final edits and that stream descriptors are cleared in final edits.

These changes prevent sending status/stop notices to deleted rooms, remove stale persisted state, and ensure final edited events no longer look like active streaming placeholders.

* Finalize streaming state and handle terminal events

Add a finalized flag to streamingState (markFinalized/isFinalized) and use it to guard finalization paths across the streaming lifecycle. Ensure streams are closed in runAgentLoopStreamStep and short-circuit when state is nil in finishStreamingWithFailure. Update responsesTurnAdapter/FinaleAgentLoop and chatCompletionsTurnAdapter to use isFinalized checks, make processResponseStreamEvent explicitly handle response.failed and response.incomplete (finalize metadata, log, and return loop-stop), and return on response.completed. Add early-finalize guard in completeStreamingSuccess. Include new tests to cover completed, failed, and finalize behavior. These changes prevent duplicate finalization/races and ensure terminal events stop the loop and close resources correctly.
* clean up

* Remove unused helpers and tidy imports

Cleanup: remove several unused helper functions and perform minor import/formatting tidy-ups. Removed clonePortalState (bridges/ai/portal_state_db.go), hostAuthLoginID, hasManagedCodexLogin, and resolveCodexCommand (bridges/codex/connector.go), and clearOpenClawPortalState (bridges/openclaw/metadata.go). Also adjusted imports and spacing in multiple sdk and bridge files (bridges/ai/session_store.go, bridges/ai/system_events_db.go, sdk/*) to improve code clarity. No functional behavior changes intended.

* Brand as AgentRemote CLI; update Codex/OpenClaw

Rename user-facing references to "AgentRemote CLI" across workflows, README, docker docs, help text, and Homebrew cask generation. Introduce defaultCodexClientInfoName/title constants, apply them in the Codex connector and add a unit test to assert defaults. Add a user-agent base constant for OpenClaw Gateway and use it when building client identity and tests. Minor prompt and help string tweaks to clarify wording and usage.

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* Update boss.go

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* sync

* Add connect validation and room meta updates

Validate and report bridge connection state and improve room meta handling.

- AIClient: mark connecting, validate provider via ListModels with timeout, handle auth failures by emitting BadCredentials, and defer non-auth errors while logging; only set logged-in on success.
- OpenCodeClient: emit connecting state, restore connections asynchronously, emit transient disconnect when restores fail or no instances reachable, add hasReachableOpenCodeInstance helper, and set logged-in only after successful restore.
- Bridgev2 room meta handlers: validate incoming Matrix room name/topic/avatar messages, apply content to portal fields, add validateRoomMetaMessage helper, and update unit tests to supply content and assert in-memory changes.
- Connector: remove hardcoded GetCapabilities override for OpenCode.
- SDK: make GetCapabilities context-aware (accept ctx), call currentRoomFeatures with ctx; remove automatic Custom override in convertRoomFeatures; small doc/comment wording adjustments and minor refactors.

These changes improve error reporting, make connection logic more robust, and ensure bridgev2 room metadata is validated and persisted in memory before saving.

* apply review fixes

* sync

* Refactor state handling and remove unused helpers

Multiple cleanups and safety improvements across bridges and sdk:

- bridges/ai: clear stale AI session routing when deleting sessions and add defensive ctx handling; use timestamp.IsZero() when persisting transcripts and remove an unused helper.
- bridges/codex: apply copy-on-write for portal state updates (nextState) to avoid persisting partial state on failure and adjust thread startup flow.
- bridges/openclaw: add legacy openClawLegacyLoginState and a migration helper to load/save legacy metadata into the new persisted state; stop trimming token strings when saving.
- pkg/integrations/memory: ensure StopManagersForLogin is invoked before DB checks to avoid leaving managers running.
- pkg/shared/toolspec: remove an unnecessary "remove": true constraint from the message schema.
- pkg/agents/tools: remove several redundant parameter helper functions (ReadIntDefault, ReadBool, ReadStringSlice).
- sdk: remove commands() accessors and an unused login helper to reduce API surface.

These changes improve robustness (prevent partial state changes, clear stale routing), add backward compatibility for OpenClaw metadata, and simplify the codebase by removing unused/helpers.

* Refactor DB blob helpers and desktop/OpenClaw

Add reusable DB and JSON helpers and tidy desktop/OpenClaw integrations. Introduces pkg/aidb.BlobScope with scoped Load/Save/Delete helpers and unmarshalJSONField/unmarshalMapJSONField helpers in ai/bridge_db.go. Replace many per-bridge DB scope types with BlobScope usage in codex and openclaw, simplify JSON blob handling, and remove legacy metadata parsing. Add desktopAccountNetwork stub and centralize desktop-network handling, plus tryResolveDesktopTarget to deduplicate desktop message target resolution. Change execDelete to return errors and aggregate failures during purgeLoginData. Reorder savePortal to persist before AI-specific state save. Update OpenClaw login flow to use NewLogin then LoadConnectAndCompleteLogin and improve rollback handling. Bump github.com/beeper/desktop-api-go to v0.5.0 and apply related test adjustments and small fixes across AI and SDK tests.

* Update desktop_api_native_test.go

* AI: agents enablement, login load, params & schema

Refactor agent enablement checks and command handling, ensure login initialization after saving, improve tool parameter utilities, and update message tool schema.

- Extracted agentsEnabledForLoginConfig and simplified shouldEnsureDefaultChat logic; default agents are disabled unless explicitly enabled.
- Added applyAgentsEnabledChange to centralize login config updates and return whether enabling requires creating the default welcome chat; fnAgents now uses it and only creates the welcome chat on explicit enable.
- Persisted login initialization: OpenAILogin.finishLogin now calls Connector.loadAIUserLogin after saving config and rolls back on failure.
- Tests added/updated: verify default-disabled behavior, applyAgentsEnabledChange semantics, and Magic Proxy login client loading.
- params.go: overhauled parameter readers (ReadString, ReadStringDefault, ReadIntDefault, ReadBool, ReadStringSlice, ReadStringArray, ReadMap) to tighten validation and provide defaults and helpers.
- toolspec: expanded Message tool actions/fields and updated description; added tests ensuring sanitized schemas strip top-level composition keywords.

These changes fix correctness around agent enablement defaults, consolidate update logic, ensure persisted logins initialize clients properly, and provide more robust parameter parsing and tool schemas.

* Introduce AI turn store and portal scope changes

Replace the old AI transcript/internal-prompt persistence with a canonical "turn" store and tighten portal scoping. New ai_turns/ai_turn_refs semantics are introduced (replacing aiTranscript/aiInternalMessages usage), and portal-scoped DB rows now use portal_receiver (and strict canonical bridge_id) instead of login_id. Added message_helpers.go and a new turn_store implementation (turns & refs), removed the legacy transcript/internal_prompt DB files, and implemented advanceAIPortalContextEpoch with context_epoch/next_turn_sequence fields on persisted portal records. Updated callers and tests to use persistAIConversationMessage/loadAIConversationMessage/loadAIPromptHistoryTurns/persistAIInternalPromptTurn/deleteAITurnsForPortal/deleteAITurnByExternalRef and adjusted logging/messages from "transcript" to "turn/conversation". Also updated portal state loading/saving to return a portal record and updated DB queries to match the new schema and scoping rules; tests adapted to verify epoch/reset behavior.

* Remove canonical history & related helpers

Delete canonical_history.go and remove several helper functions used for assembling history messages and image downloads. This removes isImageMimeType and shouldIncludeInHistory, deletes loadAITurnByID, and updates upsertAITurn to set contextEpoch to 0 instead of using record.ContextEpoch. These changes simplify history handling by dropping previously generated-image injection and related filtering/lookup logic.

* Delete slice_arg.go

* Resolve canonical portal scope with context

Add context-aware canonicalization helpers and switch AI DB code to use them. Introduces canonicalPortalForAIDB and portalScopeForAIDB (with context) in bridge_db.go, updates multiple DB/turn/state functions to call portalScopeForAIDB and propagate errors, and fixes related error handling. Adds a test (persistence_boundaries_test.go) that ensures history is replayed for transient portals by canonicalizing portal lookup. Also imports context where needed and tweaks an SQL err assignment. Additionally, add root-level pre-commit hooks for go vet and staticcheck in .pre-commit-config.yaml.

* ai: use canonical IDs and turn checkpoints

Introduce canonicalLoginBridgeID/canonicalLoginID helpers and replace ad-hoc string conversions throughout the AI bridge to ensure consistent, trimmed bridge/login identifiers and stricter validation. Add assistantTurnCheckpoint and related logic to track assistant turns by canonical sequence/epoch instead of relying solely on timestamps; update API names and usages (LastAssistantTurnCheckpoint, waitForAssistantTurnAfter, latestAssistantTurnRecord, etc.) and adapt scheduler, sessions, integrations, and message-waiting logic to use the new checkpoint semantics. Persist/load login config changes: finishLogin now passes a LoadUserLogin hook to initialize login state before persisting, and OpenAI connector supports loadAIUserLoginWithConfig. Add tests and a DB-backed login harness for these flows. Improve error handling and logging for AI history/turn scope access and textFS store creation. Also switch RemoteEdit stream-order fallback to ResolveEventTiming and add corresponding tests.

* Fallback to bridge DB ID for portal/login scope

Allow scope resolution to fall back to the runtime bridge database ID when portal or login wrappers lack an embedded BridgeID. Added canonicalBridgeDBID and client-scoped helpers (canonicalPortalForClientAIDB, portalScopeForClientAIDB) and refactored history/turn-loading functions to accept/produce portalScope variants. Updated callers across the AI bridge to canonicalize portals via the client and to rely on login-scoped contexts (loginScope/portalScope) instead of requiring embedded bridge IDs everywhere. Added tests to cover saving/loading login config with empty persisted BridgeID and replaying history for transient/missing portal wrapper cases.

* Refactor AI portal DB scope and messaging

Introduce client-scoped portal DB resolution and scope-based turn operations, and centralize portal message sending.

Changes:
- Add portalScopeForClientAIDB usage and logic to resolve DB, bridgeID and portal receiver from canonical portal when client-scoped context is needed (bridge_db.go).
- Replace direct portalScopeForAIDB calls with oc.portalScopeForClientAIDB across integration and persistence code paths to support client-scoped DB access (integration_host.go, turn_store.go, load/persist functions).
- Add scope-aware persistence helpers: upsertAITurnByScope, deleteAITurnByExternalRefByScope, loadAIConversationMessageByScope, hasInternalPromptHistoryByScope and related AIClient wrapper methods to operate using resolved portalScope (turn_store.go).
- Refactor message sending: introduce buildConvertedPortalTextMessage and sendPortalMessage; route system notices through the same pipeline and use converted messages when sending (chat.go). Update tests to validate converted message structure (portal_send_test.go).
- Make sendWelcomeMessage return errors and use sendPortalMessage; persist/rollback welcome state and log failures rather than silent returns. Ensure callers handle errors when sending welcome messages (handleai.go, portal_materialize.go).
- Update persistence flows to canonicalize the portal early, extract turn data, and upsert via scope-aware functions (turn_store.go). Added tests for client-scoped turn persistence and transient portal loading (persistence_boundaries_test.go).

Why: These changes allow AI client logic to correctly operate when the portal is detached from a portal-specific bridge/database, unify sending paths for AI/system messages, and make persistence operations robust to client-scoped DB contexts and transient portals. Logging and error propagation were improved to avoid silent failures.

* sync

* syn

* wip

* wip

* sync

* Refactor AI queue, room locks, portal bootstrap

Extract queue/room-run runtime and locking into a new bridges/ai/queue_runtime.go, replacing the old activeRooms-based logic with roomLocks and consolidating inflight checks. Replace multiple direct ConfigureDMPortal/EnsurePortalLifecycle calls with a new SDK helper SDK.BootstrapDMPortal (added sdk/portal_bootstrap.go) and adapt callers in codex, openclaw, opencode and ai chat initialization to use the new DMPortalBootstrapSpec/Result flow. Update tests and remove obsolete files (active_room_state.go, room_activity.go), plus adjust related naming and behavior to centralize bootstrap/save/mutate semantics and improve per-room concurrency handling.

* wip

* sync

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Unify chat creation & approval start flows

Consolidate chat creation and portal materialization into a single constructor and preparer: add chatCreateParams and createChat, replace createAgentChatWithModel/createNewChat/maybeCreateResolvedChat, and centralize save/materialize via prepareCreatedChatPortal with an optional mutate callback. Introduce SDK StartApprovalRequest (sdk/approval_request_start.go) to centralize approval request start/register/emit/send choreography and update AI, Codex, and SDK turn code to use it (tool approvals now use the new StartApprovalRequest API and pending data). Update subagent spawn, agent store, and related code to use the new paths. Minor docs updated to reflect the rewrite goals.

* wip

* Refactor portal/chat resolution and approvals

Introduce a shared ensureNamedPortalRoom helper to centralize loading/mutating/saving/materializing portal rooms and use it from integration host and scheduler flows. Consolidate ghost-derived chat target parsing into resolveParsedChatGhostTarget and streamline resolveChatTargetFromIdentifier/FromGhost to use it. Replace waitForToolApprovalDecision with waitForToolApprovalResponse that returns the SDK ToolApprovalResponse directly, and update continuation logic to consume the response (Approved/Reason) instead of rehydrating a runtime decision. Add necessary import and update docs to reflect these changes.

* wip

* wip

* wipwip

* wip

* Delete AI prompt and heartbeat wrapper layers

* Delete AI session and provider wrapper layers

* Delete leftover AI and SDK trampolines

* Collapse SDK runtime getter bag

* Delete AI queue dispatch shells

* Collapse AI streaming lifecycle handling

* Collapse AI heartbeat routing

* Delete AI status delivery wrappers

* Delete AI streaming UI accessor shims

* Inline AI reply accumulator finalization

* Delete AI portal send wrapper

* Delete AI portal edit wrapper

* Delete dead AI integration host methods

* Delete unused AI integration host surface

* Delete dead AI approval helper

* Delete dead AI system event helpers

* Inline SDK client cache loading

* Inline continuation message construction

* Unify AI portal chat info flow

* Collapse heartbeat session helper layer

* Inline connector cache lifecycle

* Inline AI continuation reply relation

* Delete SDK cache removal wrapper

* Delete AI prompt and activity wrappers

* Delete SDK message and broken-login wrappers

* Inline AI prompt context helpers

* Inline approval and retrieval defaults

* Delete Exa provider wrappers

* Inline remaining shared helper wrappers

* Inline AI queue and prompt projection helpers

* Collapse retrieval env default helpers

* Inline AI chat and streaming wrappers

* Delete test-only and bridgeutil wrappers

* Inline AI queue drop policy

* Inline direct fetch defaults

* Inline chat tool loop continuation logic

* Delete retrieval env wrapper layer

* Inline heartbeat session resolution

* Inline retrieval provider registration

* Inline Exa search result helpers

* Inline retrieval provider constructors

* Delete prompt and chat wrapper leftovers

* Inline SDK approval and bridge info helpers

* Delete bridge-local status wrappers

* Inline AI current-turn prompt assembly

* Inline AI contact resolution wrappers

* Inline SDK approval prompt formatting helpers

* Collapse AI retrieval token helper chain

* Refresh rewrite docs after wrapper deletions

* Merge AI login load entrypoints

* Collapse streaming terminal state ownership

* Merge AI heartbeat session ownership

* Inline AI responder resolution wrappers

* Trim integration host passthrough surface

* Collapse SDK stream state ownership

* Delete AI prompt and state shim helpers

* Delete remaining AI single-use wrappers

* Refresh rewrite docs after wrapper cuts

* Inline assistant turn checkpoint helpers

* Inline SDK capability and message adapters

* Inline responses stream error finalization

* Collapse responses terminal timestamp ownership

* Delete prompt builder wrapper paths

* Inline prompt turn-data persistence

* Centralize session timestamp lookup routing

* Move route lookup into session store

* Inline terminal timestamp writes

* Inline steering continuation input

* Collapse prompt history loading path

* Delete OpenAI base URL wrapper

* Inline SDK provider identity resolution

* Trim chat completions error helper inputs

* Unify image generation service resolution

* Reuse service config for media providers

* Share streaming step-error finalization

* Create canonical media provider spec table

* Unify heartbeat session routing

* Inline heartbeat finalization branches

* Wire cron integration to scheduler directly

* Delete SDK command runtime downcast

* Delete prompt tail wrapper

* Remove memory identity from integration host

* Inline SDK runtime state helper

* Drop redundant session portal login input

* Inline agent resolution defaulting

* Inline user prompt message construction

* Trim integration host agent helpers

* Remove module-enabled host requirement

* Flatten canonical prompt replay

* Delete SDK runtime state bag

* Collapse AI session store operations

* Unify queued prompt dispatch path

* Delete provider and queue wrappers

* Inline heartbeat and provider config branches

* Inline heartbeat finalization locals

* Inline heartbeat scheduler filters

* Flatten streaming terminal branches

* Inline heartbeat route helpers

* Unify heartbeat launch boundary

* Inline retrieval proxy defaults

* Collapse media auto selection

* Inline image generation provider configs

* Inline tool config loading

* Inline session tool routing

* Inline OpenRouter media config

* Delete stale SDK and runtime wrappers

* Unify pending prompt assembly

* Flatten queue acceptance flow

* Scope heartbeat admission to target rooms

* Collapse room occupancy state

* Delete queue wrappers and dead SDK media helpers

* Trim runtime host wrapper surface

* Delete dead SDK replay helpers

* Flatten heartbeat route resolution

* Inline heartbeat delivery route types

* Collapse AI turn canonicalization

* Unify agent loop run launch

* Unify textfs write side effects

* Collapse retrieval config assembly

* Collapse turn metadata projection

* Delete prompt turn reparse path

* Centralize textfs store construction

* Type agent module config lookup

* Extract turn part schema helpers

* Unify final edit payload assembly

* Parse memory runtime config once

* Delete duplicated session and policy resolvers

* Test direct memory prompt injection wiring

* Delete approval and continuation wrappers

* Trim dead runtime host clock surface

* Delete dead turn and final edit accessors

* Delete session routing bag and dead prompt flag

* Collapse user prompt projection

* Delete dead regenerate prompt parameter

* Fix runtime fallout and delete dead sdk helpers

* Delete dead ai replay and openclaw helpers

* Delete dead generic helper packages

* Inline final wrapper aliases

* Rewrite AI room lifecycle ownership

* Fix welcome notices for provisioned chats

* Use bridgev2 hook for AI welcome notices

* Collapse DM room lifecycle and notice paths

* Collapse AI disclaimer and default-room paths

* Cut AI wrappers and unify room lifecycle

* Align AI bridge crypto policy with bridgev2

* Match AI bridge crypto policy to WhatsApp and Signal

* Route AI portal notices through remote event queue

* Queue portal notices through bridgev2 remote events

* Remove sender preflight from queued sends

* Canonicalize room IDs for status events

* Stop advertising AI backfill support

* Use canonical timing for system notices

* Refactor queue/dispatch and status handling

Change dispatch/queue flow to return errors and centralize status events handling. Key changes:

- dispatchOrQueueCore now returns error instead of bool and no longer saves messages directly; callers save messages and handle responses/errors.
- Removed queueAcceptedStatusKey and related logic; status events are now propagated via statusEventsKey and statusEventsFromContext.
- Added buildUserMessageResponse and postSaveUserMessage to centralize post-save persistence, AI-turn persistence and session mutation notifications.
- notifyMatrixSendFailure now uses status events from context and sends status for each explicit event.
- Updated handlers (matrix, media, internal dispatch, debounce) to call dispatchOrQueueCore and handle returned errors; pending/pendingSent logic adjusted.
- Simplified queue runtime logic (dispatchPromptRun/processing) and removed some pending-status side effects from dispatchOrQueueCore.
- Updated tests to match new behavior and expectations (queue status, dispatch/queue error handling).
- Minor SDK change: Turn.buildRelatesTo simplified to use SetThread/SetReplyTo helpers.

These changes consolidate status propagation, improve error handling for dispatch/queue operations, and centralize message post-save logic.

* Persist accepted messages & room-run status

Introduce tracking and persistence of accepted user messages tied to room-run state and improve queued message status handling. Key changes:
- Add acceptedMessage to pendingQueueItem and record accepted messages in roomRunState.acceptedMessages.
- Replace buildUserMessageResponse with persistAcceptedUserMessage and add persistAcceptedRoomRunMessages + consumeRoomRunAcceptedMessages to mirror accepted messages into the AI turn store.
- Implement sendPendingMessageStatus to emit Matrix message status events for queued items and use roomRunStatusEvents instead of context-based statusEvents; remove status_events_context.go.
- Update dispatch/queue/handler callsites to attach accepted messages to queue items and return Pending responses for enqueued items.
- markMessageSendSuccess now persists accepted room-run messages and marks statusSent appropriately.
- Adjust tests to use the new room-run status mechanism.

* Persist accepted messages and send MSS

Replace single accepted-message echo flow with direct persistence and Message Status (MSS) handling. Key changes:

- Replace pendingQueueItem.acceptedMessage with acceptedMessages []*database.Message and thread this through queue/dispatch preparation.
- Remove remote accepted-message echo events; persist accepted messages directly via persistAcceptedUserMessage and send success MSS using new sendSuccessMessageStatus/consumeRoomRunStatusEvents helpers.
- Add room run helpers: consumeRoomRunStatusEvents, roomRunAccepted, and streamingState.accepted flag with markAccepted/isAccepted.
- Introduce markTurnAccepted to mark a turn accepted, trigger acceptance side-effects, and start the UI placeholder send once (idempotent).
- Capture current user-visible text into streamingState.currentUserMessage using promptCurrentUserVisibleText and populate it before streaming runs.
- Simplify runAgentLoopStreamStep signature (remove portal/evt/shouldMarkSuccess) and update call sites.
- Add/adjust tests for accepted-message collection, status event draining, prompt text extraction, acceptance persistence/MSS sending, and placeholder send idempotency.
- Update testMatrixConnector to record sent MessageStatus and MessageStatusEventInfo for assertions.

These changes consolidate acceptance logic, ensure accepted messages are saved to the DB, and ensure Matrix message status events are sent appropriately when agent turns are accepted.

* fix PR review issues

* remove remaining openclaw references

* align bridgev2 persistence usage

* remove redundant turn data clone

* remove unused turn data clone helper

* Refactor memory integration & simplify AI clients

Move memory state into pkg/integrations/memory (add State type and tests), update PortalMetadata and memory integration code to use the new integrationmemory.State and Meta type, and remove the old runtime MemoryState implementation. Simplify OpenAIConnector client caching and lifecycle: remove complex lookup/publish logic and replace with a straightforward map swap that disconnects the previous AIClient when replaced. Misc: tighten group chat activation handling, stop returning Pending on MatrixMessageResponse in several handlers, set DeleteOnConflict when persisting login completions, remove several unused/legacy bridge AI helpers and toast files, and remove various schema backfill/migration and column helper code. Also remove CommandDefinition Aliases field in module hooks and adjust imports accordingly.

* Support skipping room creation and schema updates

Introduce SkipRoomCreation to chat creation so chats can be created without materializing Matrix rooms or sending disclaimers (left to bridgev2). Add corresponding test updates and propagate the flag into Codex welcome chat flows. Register static integration commands (cron, memory) at connector startup and fix command handler copying to avoid shared closures. Replace turn sequence allocation with an atomic upsert that handles nil scopes/contexts and return context values; ensure senders are joined before sending events. Convert ApprovalFlow.SendPrompt to return an error and update its caller; remove legacy conversation-state metadata bootstrap in favor of a DB-backed sdk_conversation_state table (added to SQL/migrations and tests). Misc: adjust DM power levels, tweak memory session SQL formatting, and change aichats_memory_session_files primary key.

* Refactor redaction and fix queue/runtime

Extract network message redaction into redactNetworkMessageViaPortal and replace inline simplevent.MessageRemove usages to centralize error handling. Add purgeLoginRuntimeState to consolidate login cleanup. Ensure pending queue items are populated with Portal/Meta/Event when queued or dispatched, prevent duplication of accepted messages and status events for steer+backlog, and add tests covering queue summary and steering behaviors. Also tighten executeMessageDelete to use redactEventViaPortal and propagate errors, and add a nil-check for portal.Bridge in typing context to avoid panics.

* Refactor DB upgrades, SDK cleanup, codex rename

Multiple refactors and feature updates across bridges and SDK:

- Migrate AI DB schema handling to db.Upgrade: aidb now registers an UpgradeTable and NewChild uses it; code and tests updated to call Upgrade instead of EnsureSchema.
- Add SDK conversation state deletion helpers and call them on chat delete and login purge to clean persisted SDK state.
- Make custom agents DB functions return an explicit error when the DB scope is unavailable.
- Remove scheduler_rooms and stop forcing scheduled room creation during cron/heartbeat handling; code updated to resolve delivery targets without ensuring rooms.
- Rename Codex command prefix and user-facing strings from "!ai" to "!codex" and update related behavior and tests.
- Simplify bridge entrypoint RunMain signature and call path (bridgeentry changes) and adjust run_bridge invocation.
- Simplify reaction/message parsing in SDK and remove several deprecated SDK types and hooks (message edits, reactions, model/chat/user info), trimming unused code.
- Clean up agentremote CLI: remove legacy up/down commands and deprecated flags; update README to reference start instead of up.
- Misc tests and small cleanups (memory purge query tweak, scheduler/heartbeat test updates, various nil checks and error messages).

These changes centralize DB migration handling, improve SDK state cleanup, simplify scheduler semantics, and update the Codex bridge command UX.

* Simplify queuing and unify tool/tooltype handling

Major refactor of AI/codex bridge behavior and tool typing:

- Remove direct Matrix MessageStatus sending in many places (pending/success/error) and update tests accordingly.
- Simplify queuing/dispatch logic: remove debounce, steer/backlog mechanics and pending queue workflows; new behaviour returns a retriable error when a turn is already running in a room.
- Refactor Codex client to drop per-room pending message queue and adjust room acquisition semantics (acquireRoomIfIdle); remove related helpers and tests.
- Replace local ToolType alias with matrixevents.ToolType throughout streaming/tool execution code and tests; update imports.
- Adjust AgentStore ListAvailableTools to return toolspec.ToolInfo and fix sessions/tools argument parsing.
- Misc: import cleanup and small API/test updates to reflect these changes.

These changes consolidate tool-type usage and simplify room/queue lifecycle handling across the bridges.

* Reorder imports and fix test reassignment

Move github.com/beeper/agentremote/sdk import to the end of import blocks to better group external packages, and remove a redundant portal reassignment in cacheHeartbeatTestPortals (heartbeat_delivery_test.go) that could mask saved state. No behavior changes aside from the test cleanup and import formatting.

* Fix AI bridgev2 persistence and status handling

* Flatten AI command registration

* Inline AI bridge connector lifecycle

* Inline Codex bridge connector lifecycle

* Remove integration host logger facade

* Centralize inbound turn metadata attachment

* Build streaming turn metadata once

* Prune AI bridge files and update core handlers

Remove many deprecated/unused bridges/ai modules and tests, consolidate runtime stubs, and update core AI handlers and command entry points. Key changes: bulk-deleted legacy AI bridge sources and tests, added run_dispatch.go, simple_runtime_stubs.go and tool_approval_auto.go, and modified core files such as abort_helpers.go, bridge_db.go, bridge_info.go, chat.go, client.go, commands.go, connector.go, events.go, identifiers.go, image_understanding.go, integrations_config.go, login_config_db.go, login_state_db.go, logout_cleanup.go, media_send.go, metadata.go, portal_materialize.go, reaction_handling.go, responder_resolution.go, response_finalization.go, response_retry.go, streaming_* handlers, tools/* and typing_mode.go. Also updated cmd/agentremote entry code and added bridgeentry tests, adjusted pkg/aidb migration and db tests, and tweaked retrieval and streamui tooling. This restructures and simplifies the AI bridge surface to remove legacy code and consolidate runtime/dispatch logic.

* Remove session, reactions and text-file handling

Remove legacy session store and reaction feedback subsystems and disable text-file/PDF media understanding. Key changes:
- Deleted session_store.go and reaction_feedback.go; removed related session config fields and example config entries.
- Removed context pruning tests and other unused tests/files.
- Dropped several AI DB table constants from bridge_db.go.
- Disabled/removed handling for text file and PDF attachments (errors returned where previously processed) and removed extraction of text blocks from media attachments.
- Removed reaction feedback draining and related prompt enrichment code paths.
- Removed various notifySessionMutation and recordAgentActivity calls to reduce session mutation notifications.
- Small cleanup: simplified tool name mapping, event constants alignment, and other housekeeping in multiple AI bridge files.

These changes simplify the AI bridge by removing session/reaction-based features and text-file media understanding; callers should expect those flows to return unsupported errors or be no-ops.

* Remove agent-specific handling and rename components

Remove legacy agent-related code and simplify to a model/assistant-only flow. Agent-specific identifiers, parsing, and helpers were removed (agent ghost IDs, agent user ID helpers, agent-related metadata and responder fields). Commands and validation paths for agents were deleted or updated so parsing/validation now focuses on model ghost IDs. Several functions and terms were renamed to reflect streaming/transcript semantics (e.g. runAgentLoop* -> runStreaming*, launchAgentLoopRun -> launchStreamingRun, AgentRemote -> Transcript), media/UX wording changed from "agent" to "assistant" or "model", and related tests were updated. Miscellaneous cleanup: remove unused imports, simplify bridge info application, and adjust queue/dispatch, session transcript, image understanding, and room capabilities to the simplified model-only behavior.

* Refactor AI chat and update model manifest

Split and reorganize AI chat functionality (moved contact/search and resolve logic out of chat.go into chat_contacts.go and chat_resolve.go), cleaned up imports and removed many now-unneeded helper functions. Simplified ModelManifest by removing per-model API fields and the Aliases map. Removed obsolete files (e.g. audio_mime.go and several legacy helpers) and added numerous new AI bridge modules (client scaffolding, media understanding, pending queue, provider OpenAI middleware/tools, tool schema helpers, turn store helpers, etc.), plus related Codex and SDK additions and tests. Overall this is a large reorganization to separate concerns and introduce new AI/bridge capabilities.

* AI: membership handling, media tests, and runtime options

Add matrix membership handling to switch portal model ghosts (HandleMatrixMembership + switchPortalModel) and update model lookup to consult ModelManifest in findModelInfo. Tighten media capability checks in canUseMediaUnderstanding to validate client and model support. Add tests for membership switching, queue collection, room capabilities, and media sending (including audio upload validation) and adjust test helpers to capture upload metadata. Move and consolidate runtime command option parsing into a new runtime_command_options.go (removing the duplicate implementations and unused imports), including parsing/validation utilities for command tokens and ranges.

* Move reply policy to reply_target and simplify

Consolidate and simplify Matrix reply/thread handling: remove the old reply_policy and runtime threading logic and replace it with a new bridges/ai/reply_target.go that extracts and resolves reply targets more directly. Drop per-channel ChannelsConfig and example config entries, and remove related runtime reply threading helpers and types (pkg/runtime/reply_threading.go and associated types/tests). Update streaming state to apply explicit reply directives without the previous ApplyReplyToMode policy, and clean up ai status output to no longer show the removed reply settings. Adjust runtime tests accordingly.

* Fix PR review feedback

* Remove unused dead code
Remove the default aiHelper client, command registration, connector implementation and related connector tests to decouple provider-specific bridge logic from the shared helpers. Move pending approval metadata into turn_approval, expose Conversation.CurrentRoomFeatures, and add RoomFeatures helpers (DefaultRoomFeatures and RoomFeaturesToMatrix) to convert shared feature config into Matrix event.RoomFeatures. Simplify the Config type to focus on shared AI conversation helpers (trim many connector/bridge-specific fields) and update NewConversation documentation to reflect that provider bridges may drive their own bridgev2 clients. This refactor reduces coupling and surface area of the shared helpers so providers implement network-specific behavior themselves.
Remove the extra Config generic/type (ConfigDataT / ConfigValue) from aihelpers types and APIs and update call sites. The Config and NewConversation signatures now take a single SessionT type parameter; callers in connector and test files were updated accordingly (pkg/shared/aihelpers/*.go and pkg/connector/*_test.go and streaming_init.go).

Also rename sdkApprovalHandle to aiApprovalHandle (and update its methods/return sites) and rename a local variable (sdkConfig -> conversationConfig) for clarity. Tests and helper code were adjusted to match these API changes.
Replace product-specific strings and examples with more generic values and clarify comments. Updated tests to use a generic protocol id and internal room kind (pkg/connector/system_prompts_test.go, pkg/shared/aihelpers/helpers_test.go). Simplified wording in approval flow comments to remove product mentions (pkg/shared/aihelpers/approval_flow.go). Clarified the LogKey comment to a generic example (pkg/shared/aihelpers/remote_events.go). These changes reduce coupling to specific product names and improve clarity.
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.2.0 to 6.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@7a3fe6c...4a36011)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code labels May 8, 2026
@batuhan batuhan closed this May 24, 2026
@dependabot @github
Copy link
Copy Markdown
Author

dependabot Bot commented on behalf of github May 24, 2026

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot Bot deleted the dependabot/github_actions/actions/setup-go-6.4.0 branch May 24, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code

Development

Successfully merging this pull request may close these issues.

1 participant