Skip to content

Commit 377c734

Browse files
authored
fix(telegram): keep extracted helper types local
1 parent b55ea43 commit 377c734

171 files changed

Lines changed: 9503 additions & 6267 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/control-ui-locale-refresh.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ jobs:
276276
with:
277277
install-bun: "false"
278278

279+
- name: Finalize control UI generated artifacts
280+
run: node --import tsx scripts/control-ui-i18n.ts sync --write
281+
279282
- name: Validate control UI locale refresh
280283
run: node --import tsx scripts/control-ui-i18n.ts check
281284

‎apps/macos/Package.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
dependencies: [
1818
.package(url: "https://github.com/orchetect/MenuBarExtraAccess", exact: "1.3.0"),
1919
.package(url: "https://github.com/swiftlang/swift-subprocess.git", from: "0.4.0"),
20-
.package(url: "https://github.com/apple/swift-log.git", from: "1.10.1"),
20+
.package(url: "https://github.com/apple/swift-log.git", from: "1.12.0"),
2121
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.9.0"),
2222
.package(url: "https://github.com/steipete/Peekaboo.git", exact: "3.9.0"),
2323
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.3.1"),

‎apps/macos/Sources/OpenClaw/DebugSettings.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct DebugSettings: View {
2424
@State private var tunnelResetStatus: String?
2525
@State private var pendingKill: DebugActions.PortListener?
2626
@AppStorage(debugFileLogEnabledKey) private var diagnosticsFileLogEnabled: Bool = false
27-
@AppStorage(appLogLevelKey) private var appLogLevelRaw: String = AppLogLevel.default.rawValue
27+
@AppStorage(appLogLevelKey) private var appLogLevelRaw: String = Logger.Level.info.rawValue
2828

2929
@State private var canvasSessionKey: String = "main"
3030
@State private var canvasStatus: String?
@@ -275,7 +275,7 @@ struct DebugSettings: View {
275275
self.gridLabel("App logging")
276276
VStack(alignment: .leading, spacing: 8) {
277277
Picker("Verbosity", selection: self.$appLogLevelRaw) {
278-
ForEach(AppLogLevel.allCases) { level in
278+
ForEach(Logger.Level.allCases, id: \.rawValue) { level in
279279
Text(level.title).tag(level.rawValue)
280280
}
281281
}

‎apps/macos/Sources/OpenClaw/Logging/OpenClawLogging.swift‎

Lines changed: 11 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,7 @@ enum AppLogSettings {
2626
}
2727
}
2828

29-
enum AppLogLevel: String, CaseIterable, Identifiable {
30-
case trace
31-
case debug
32-
case info
33-
case notice
34-
case warning
35-
case error
36-
case critical
37-
38-
static let `default`: AppLogLevel = .info
39-
40-
var id: String {
41-
self.rawValue
42-
}
43-
29+
extension Logger.Level {
4430
var title: String {
4531
switch self {
4632
case .trace: "Trace"
@@ -140,29 +126,9 @@ struct OpenClawOSLogHandler: AppLogLevelBackedHandler {
140126
}
141127

142128
func log(event: LogEvent) {
143-
self.writeLog(level: event.level, message: event.message, metadata: event.metadata)
144-
}
145-
146-
func log(
147-
level: Logger.Level,
148-
message: Logger.Message,
149-
metadata: Logger.Metadata?,
150-
source: String,
151-
file: String,
152-
function: String,
153-
line: UInt)
154-
{
155-
self.writeLog(level: level, message: message, metadata: metadata)
156-
}
157-
158-
private func writeLog(
159-
level: Logger.Level,
160-
message: Logger.Message,
161-
metadata: Logger.Metadata?)
162-
{
163-
let merged = Self.mergeMetadata(self.metadata, metadata)
164-
let rendered = Self.renderMessage(message, metadata: merged)
165-
self.osLogger.log(level: Self.osLogType(for: level), "\(rendered, privacy: .public)")
129+
let merged = self.metadata.merging(event.metadata ?? [:], uniquingKeysWith: { _, new in new })
130+
let rendered = Self.renderMessage(event.message, metadata: merged)
131+
self.osLogger.log(level: Self.osLogType(for: event.level), "\(rendered, privacy: .public)")
166132
}
167133

168134
private static func osLogType(for level: Logger.Level) -> OSLogType {
@@ -180,14 +146,6 @@ struct OpenClawOSLogHandler: AppLogLevelBackedHandler {
180146
}
181147
}
182148

183-
private static func mergeMetadata(
184-
_ base: Logger.Metadata,
185-
_ extra: Logger.Metadata?) -> Logger.Metadata
186-
{
187-
guard let extra else { return base }
188-
return base.merging(extra, uniquingKeysWith: { _, new in new })
189-
}
190-
191149
private static func renderMessage(_ message: Logger.Message, metadata: Logger.Metadata) -> String {
192150
guard !metadata.isEmpty else { return message.description }
193151
let meta = metadata
@@ -203,59 +161,21 @@ struct OpenClawFileLogHandler: AppLogLevelBackedHandler {
203161
var metadata: Logger.Metadata = [:]
204162

205163
func log(event: LogEvent) {
206-
self.writeLog(
207-
level: event.level,
208-
message: event.message,
209-
metadata: event.metadata,
210-
source: event.source,
211-
file: event.file,
212-
function: event.function,
213-
line: event.line)
214-
}
215-
216-
func log(
217-
level: Logger.Level,
218-
message: Logger.Message,
219-
metadata: Logger.Metadata?,
220-
source: String,
221-
file: String,
222-
function: String,
223-
line: UInt)
224-
{
225-
self.writeLog(
226-
level: level,
227-
message: message,
228-
metadata: metadata,
229-
source: source,
230-
file: file,
231-
function: function,
232-
line: line)
233-
}
234-
235-
private func writeLog(
236-
level: Logger.Level,
237-
message: Logger.Message,
238-
metadata: Logger.Metadata?,
239-
source: String,
240-
file: String,
241-
function: String,
242-
line: UInt)
243-
{
244164
guard AppLogSettings.fileLoggingEnabled() else { return }
245165
let (subsystem, category) = OpenClawLogging.parseLabel(self.label)
246166
var fields: [String: String] = [
247167
"subsystem": subsystem,
248168
"category": category,
249-
"level": level.rawValue,
250-
"source": source,
251-
"file": file,
252-
"function": function,
253-
"line": "\(line)",
169+
"level": event.level.rawValue,
170+
"source": event.source,
171+
"file": event.file,
172+
"function": event.function,
173+
"line": "\(event.line)",
254174
]
255-
let merged = self.metadata.merging(metadata ?? [:], uniquingKeysWith: { _, new in new })
175+
let merged = self.metadata.merging(event.metadata ?? [:], uniquingKeysWith: { _, new in new })
256176
for (key, value) in merged {
257177
fields["meta.\(key)"] = stringifyLogMetadataValue(value)
258178
}
259-
DiagnosticsFileLog.shared.log(category: category, event: message.description, fields: fields)
179+
DiagnosticsFileLog.shared.log(category: category, event: event.message.description, fields: fields)
260180
}
261181
}

‎apps/macos/Sources/OpenClaw/MenuContentView.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct MenuContent: View {
2323
@State private var micRefreshTask: Task<Void, Never>?
2424
@State private var browserControlEnabled = true
2525
@AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = false
26-
@AppStorage(appLogLevelKey) private var appLogLevelRaw: String = AppLogLevel.default.rawValue
26+
@AppStorage(appLogLevelKey) private var appLogLevelRaw: String = Logger.Level.info.rawValue
2727
@AppStorage(debugFileLogEnabledKey) private var appFileLoggingEnabled: Bool = false
2828

2929
init(state: AppState, updater: UpdaterProviding?) {
@@ -278,7 +278,7 @@ struct MenuContent: View {
278278
}
279279
Menu {
280280
Picker("Verbosity", selection: self.$appLogLevelRaw) {
281-
ForEach(AppLogLevel.allCases) { level in
281+
ForEach(Logger.Level.allCases, id: \.rawValue) { level in
282282
Text(level.title).tag(level.rawValue)
283283
}
284284
}

‎docs/docs_map.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,8 +3437,8 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
34373437
- Route: /gateway/gateway-lock
34383438
- Headings:
34393439
- H2: Why
3440-
- H2: Two layers
3441-
- H3: File lock
3440+
- H2: Three layers
3441+
- H3: State and config locks
34423442
- H3: Socket bind
34433443
- H2: Operational notes
34443444
- H2: Related

‎docs/web/control-ui.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ The **+** in the sidebar session-list header opens a full-page draft at `/new`:
176176

177177
Inside **Settings**, the dedicated sidebar starts with a **Search settings** field for quickly finding settings sections.
178178

179-
A **Search** field at the top of the sidebar opens the command palette (⌘K). Clicking the OpenClaw brand in the sidebar header opens the clean New session start screen. When something needs action — failed or overdue cron jobs, expiring or expired model auth — compact attention chips appear above the sidebar footer and click through to the owning page. The compact footer keeps connection status, **Settings**, **Docs**, mobile pairing, and the light/dark/system color-mode toggle together; when the gateway runs from a source checkout on a branch other than `main`, the footer also shows that branch name in red so a non-release gateway is obvious at a glance (release installs never show it). Shift-Command-Comma opens **Settings** without overriding the browser's Command-Comma shortcut. The sidebar header also holds the collapse toggle (⌘B); collapsing hides the sidebar entirely for a full-width workspace, and a floating expand control (or ⌘B) brings it back; the macOS app hosts that toggle natively in the titlebar instead. The sidebar is the only navigation chrome on desktop, with no top bar. Narrow viewports swap the sidebar for a slide-over drawer behind a compact header row holding the drawer toggle, brand, and command-palette search; in the macOS app that header row folds the titlebar clearance into a single compact strip beside the window controls. Navigation uses regular browser history, so the browser's back/forward buttons traverse it; the macOS app adds a native sidebar toggle next to the window controls plus trackpad swipe gestures, with back/forward buttons at the sidebar's right edge while it is expanded and native search (command palette) and new-session buttons while it is collapsed.
179+
A **Search** field at the top of the sidebar opens the command palette (⌘K). Clicking the OpenClaw brand in the sidebar header opens the clean New session start screen. When something needs action — failed or overdue cron jobs, expiring or expired model auth — compact attention chips appear above the sidebar footer and click through to the owning page. The footer shows the active agent as a chip — avatar (identity image or emoji), name, connection dot, and a live subtitle — with a **+** for a new session. Clicking the chip opens the agent menu: an agent switcher (multi-agent setups), "What can this agent do?", **Agent settings**, **Settings**, mobile pairing, **Docs**, the build chip, and the color-mode toggle. Rosters above ten agents get a filter field and list pinned agents first; pin or unpin agents from the Agents settings page, with the pinned set stored in the browser profile. Choosing an agent scopes Chat plus Usage, Automations, Tasks, Workboard, and Sessions to that agent. Each scoped page exposes an **Agent** control with **All agents** as an escape; this widens the shared page scope without changing the concrete chat agent, while direct session links still open their target. The Agents settings page keeps its own `?agent=` selection and does not follow the shared page scope. When the gateway runs from a source checkout on a branch other than `main`, the footer also shows that branch name in red so a non-release gateway is obvious at a glance (release installs never show it). Shift-Command-Comma opens **Settings** without overriding the browser's Command-Comma shortcut. The sidebar header also holds the collapse toggle (⌘B); collapsing hides the sidebar entirely for a full-width workspace, and a floating expand control (or ⌘B) brings it back; the macOS app hosts that toggle natively in the titlebar instead. The sidebar is the only navigation chrome on desktop, with no top bar. Narrow viewports swap the sidebar for a slide-over drawer behind a compact header row holding the drawer toggle, brand, and command-palette search; in the macOS app that header row folds the titlebar clearance into a single compact strip beside the window controls. Navigation uses regular browser history, so the browser's back/forward buttons traverse it; the macOS app adds a native sidebar toggle next to the window controls plus trackpad swipe gestures, with back/forward buttons at the sidebar's right edge while it is expanded and native search (command palette) and new-session buttons while it is collapsed.
180180

181181
## What it can do (today)
182182

@@ -211,6 +211,7 @@ A **Search** field at the top of the sidebar opens the command palette (⌘K). C
211211
</Accordion>
212212
<Accordion title="Config">
213213
- View/edit `~/.openclaw/openclaw.json` (`config.get`, `config.set`).
214+
- Agents: a settings page (**Settings → Agents**, `/settings/agents`) with per-agent tabs (Overview, Files, Tools, Skills, Channels, Automations, Memory). The Overview tab edits the agent's identity — display name, emoji, and an avatar image that is downscaled and size-bounded in the browser before `agents.update`. Saving stores configured identity fields and mirrors them to the workspace `IDENTITY.md`; configured values take precedence over manual edits to the same file fields.
214215
- Profile: a settings page showing the default agent's identity with all-time usage stats — lifetime tokens, peak day, longest session, activity streaks, a year-long token heatmap, top tools, and channel highlights (`usage.cost`, `sessions.usage`).
215216
- MCP has a dedicated settings page with read-only server rows (transport, enablement, OAuth/filter/parallel summaries), common operator commands, and the scoped `mcp` config editor; adding, enabling/disabling, and removing servers happens on the Plugins page.
216217
- Model Providers: a settings page listing every configured model provider with its brand icon, auth state (`models.authStatus`), model availability (`models.list`), live plan/quota/billing data where the provider reports it (`usage.status`), and local session spend for the last 30 days (`sessions.usage`). A Refresh action re-reads credential state and provider usage.

‎extensions/copilot/src/attempt.ts‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ import {
3131
} from "openclaw/plugin-sdk/agent-harness-runtime";
3232
import { createCopilotByokAuth, resolveCopilotAuth } from "./auth-bridge.js";
3333
import { createCopilotByokProxy } from "./byok-proxy.js";
34-
import {
35-
createInfiniteSessionConfig,
36-
type CopilotInfiniteSessionOptions,
37-
} from "./compaction-bridge.js";
3834
import {
3935
attachCopilotMirrorIdentity,
4036
dualWriteCopilotTranscriptBestEffort,
@@ -104,7 +100,7 @@ type AttemptParamsLike = AgentHarnessAttemptParams & {
104100
cwd?: string;
105101
enableSessionTelemetry?: boolean;
106102
hooksConfig?: CopilotHooksConfig;
107-
infiniteSessionConfig?: CopilotInfiniteSessionOptions;
103+
infiniteSessionConfig?: SessionConfig["infiniteSessions"];
108104
initialReplayState?: AgentHarnessAttemptParams["initialReplayState"] & { sdkSessionId?: string };
109105
messages?: AgentMessage[];
110106
model?: string | { api?: string; id?: string; input?: string[]; provider?: string };
@@ -1331,7 +1327,6 @@ function createSessionConfig(
13311327
): CopilotSessionConfig {
13321328
const permissionPolicy = params.permissionPolicy ?? rejectAllPolicy;
13331329
const hooks = createHooksBridge(params.hooksConfig, options.hooksBridgeOptions);
1334-
const infiniteSessions = createInfiniteSessionConfig(params.infiniteSessionConfig);
13351330
return {
13361331
model: sdkModelId,
13371332
// Permission decisions for SDK built-in tool kinds (shell, write,
@@ -1371,11 +1366,8 @@ function createSessionConfig(
13711366
...(typeof params.enableSessionTelemetry === "boolean"
13721367
? { enableSessionTelemetry: params.enableSessionTelemetry }
13731368
: {}),
1374-
// Infinite sessions / background compaction: only attach when the
1375-
// host provided an InfiniteSessionConfig. SDK defaults
1376-
// (`enabled: true`, background 0.80, buffer 0.95) apply when
1377-
// omitted. See compaction-bridge.ts.
1378-
...(infiniteSessions ? { infiniteSessions } : {}),
1369+
// The SDK owns defaulting and validation for this native config block.
1370+
...(params.infiniteSessionConfig ? { infiniteSessions: params.infiniteSessionConfig } : {}),
13791371
reasoningEffort: params.reasoningEffort,
13801372
tools: sdkTools,
13811373
// Restrict the SDK's tool catalog to the bridged tool names returned

‎extensions/copilot/src/compaction-bridge.test.ts‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎extensions/copilot/src/compaction-bridge.ts‎

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)