Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 11 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,16 @@ jobs:
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
if [ -z "$APPLE_CERTIFICATE" ]; then
echo "⚠️ Apple certificate not configured, skipping code signing"
exit 0
fi
for credential in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID; do
if [ -z "${!credential}" ]; then
echo "::error::Missing required release credential: $credential"
exit 1
fi
done

KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
KEYCHAIN_PASSWORD=$(openssl rand -base64 32)
Expand Down Expand Up @@ -143,26 +148,9 @@ jobs:
BUILD_VERSION: ${{ github.run_number }}
EP_PRE_RELEASE: ${{ env.IS_PRERELEASE }}

- name: Package and publish (mac, with adhoc fallback)
- name: Package and publish (mac)
if: matrix.platform == 'mac'
run: |
LOG=$(mktemp)
set +e
pnpm --filter @clawwork/desktop exec electron-builder ${{ matrix.build_args }} --publish always -c.buildVersion="$BUILD_VERSION" 2>&1 | tee "$LOG"
status=${PIPESTATUS[0]}
set -e
if [ "$status" -eq 0 ]; then
exit 0
fi
if ! grep -q "Failed to notarize" "$LOG"; then
echo "::error::electron-builder failed for a non-notarization reason — not falling back to ad-hoc."
exit "$status"
fi
echo "::warning::Notarization failed — falling back to ad-hoc signing for ${{ matrix.arch }}."
rm -rf packages/desktop/dist
unset APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID
export CSC_IDENTITY_AUTO_DISCOVERY=false
pnpm --filter @clawwork/desktop exec electron-builder ${{ matrix.build_args }} --publish always -c.buildVersion="$BUILD_VERSION" -c.mac.identity=null -c.mac.notarize=false
run: pnpm --filter @clawwork/desktop exec electron-builder ${{ matrix.build_args }} --publish always -c.buildVersion="$BUILD_VERSION" -c.mac.type=distribution -c.mac.forceCodeSigning=true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_VERSION: ${{ github.run_number }}
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and

## [Unreleased]

## [0.0.17] - 2026-11-25

### Added

- French (`fr`) translation support (#555)
Expand All @@ -23,6 +25,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and

### Fixed

- Restored inbox attachment reads on macOS after an app restart
- Restored window dragging on title bars, and re-hydrated renderer stores after workspace changes (#491, #528)
- Hardened `safeFetch` DNS pinning, redirect handling, and incremental `maxSize` cancellation (#523, #524)
- Hardened conductor prompt injection in `initConductor`, `listSessionsBySpawner` validation, and Windows `readContextFile` path handling (#516, #519, #530)
Expand Down Expand Up @@ -223,7 +226,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and

- Initial pre-release with three-column desktop workspace, parallel task isolation, streaming responses, local Git artifact versioning, SQLite FTS5 search, light/dark themes, and challenge-response Gateway auth

[Unreleased]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.16...HEAD
[Unreleased]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.17...HEAD
[0.0.17]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.16...v0.0.17
[0.0.16]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.15...v0.0.16
[0.0.15]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.14...v0.0.15
[0.0.14]: https://github.com/clawwork-ai/ClawWork/compare/v0.0.13...v0.0.14
Expand Down
2 changes: 1 addition & 1 deletion keynote/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@clawwork/keynote",
"private": true,
"version": "0.0.16",
"version": "0.0.17",
"description": "ClawWork presentation slides powered by Slidev",
"scripts": {
"dev": "slidev --open",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clawwork",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"description": "OpenClaw desktop client with structured task management",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawwork/core",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"type": "module",
"main": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawwork/desktop",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"description": "OpenClaw desktop client with structured task management",
"type": "module",
Expand Down
15 changes: 10 additions & 5 deletions packages/desktop/src/main/inbox/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { realpathSync } from 'fs';
import { open, realpath } from 'fs/promises';
import { open, realpath, stat } from 'fs/promises';
import { resolve, sep } from 'path';

interface InboxPathInfo {
Expand Down Expand Up @@ -54,20 +54,25 @@ export async function readInboxFile(workspacePath: string, localPath: string): P
const handle = await open(info.full, 'r').catch(() => null);
if (!handle) return null;
try {
const pathToResolve = process.platform === 'win32' ? info.full : `/dev/fd/${handle.fd}`;
const realTarget =
const openedStat = await handle.stat();
if (!openedStat.isFile()) return null;
const fdTarget =
process.platform === 'win32'
? await resolveValidatedPath(info, pathToResolve)
? null
: (() => {
try {
return realpathSync(pathToResolve);
const target = realpathSync(`/dev/fd/${handle.fd}`);
return target.startsWith('/dev/fd/') ? null : target;
} catch {
return null;
}
})();
const realTarget = fdTarget ?? (await resolveValidatedPath(info, info.full));
if (!realTarget) return null;
const realInboxDir = await resolveValidatedPath(info, info.inboxDir);
if (!realInboxDir || !isWithin(realInboxDir, realTarget)) return null;
const targetStat = await stat(realTarget).catch(() => null);
if (!targetStat || targetStat.dev !== openedStat.dev || targetStat.ino !== openedStat.ino) return null;
Comment on lines +74 to +75

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve atomic confinement checks in the unresolved-fd fallback

When /dev/fd remains unresolved, as on macOS, a process that can modify the inbox can bypass this check: initially point the attachment at an outside file so open() obtains its descriptor, replace the symlink with an ordinary inbox file during resolveValidatedPath(), then restore the outside-pointing symlink before stat(realTarget). Because stat() follows symlinks, its device/inode now matches the outside descriptor, and readFile() returns that file's contents through inbox:read-file. I reproduced this with real temporary files while emulating the unresolved descriptor alias. The fallback needs descriptor-based confinement or race-resistant traversal, plus a symlink-swap regression test, to preserve the fd-centric/no-TOCTOU requirement in docs/agent-rules/main-process.md.

AGENTS.md reference: AGENTS.md:L27-L27

Useful? React with 👍 / 👎.

return await handle.readFile({ encoding: 'base64' });
} finally {
await handle.close();
Expand Down
34 changes: 33 additions & 1 deletion packages/desktop/test/inbox-resolve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ vi.mock('fs', () => ({
vi.mock('fs/promises', () => ({
open: vi.fn(),
realpath: vi.fn(),
stat: vi.fn(),
}));

import { realpathSync } from 'fs';
import { open, realpath } from 'fs/promises';
import { open, realpath, stat } from 'fs/promises';
import { readInboxFile, resolveInboxPath } from '../src/main/inbox/resolve.js';

const mockOpen = vi.mocked(open);
const mockRealpath = vi.mocked(realpath);
const mockRealpathSync = vi.mocked(realpathSync);
const mockStat = vi.mocked(stat);
const openedStat = { dev: 1, ino: 2, isFile: () => true };

describe('inbox path access', () => {
beforeEach(() => {
vi.clearAllMocks();
mockStat.mockResolvedValue(openedStat as Awaited<ReturnType<typeof stat>>);
});

it('rejects symlink escapes when resolving inbox paths', async () => {
Expand All @@ -38,6 +42,7 @@ describe('inbox path access', () => {
const close = vi.fn().mockResolvedValue(undefined);
mockOpen.mockResolvedValue({
fd: 42,
stat: vi.fn().mockResolvedValue(openedStat),
readFile,
close,
} as unknown as Awaited<ReturnType<typeof open>>);
Expand All @@ -58,6 +63,7 @@ describe('inbox path access', () => {
const close = vi.fn().mockResolvedValue(undefined);
mockOpen.mockResolvedValue({
fd: 42,
stat: vi.fn().mockResolvedValue(openedStat),
readFile,
close,
} as unknown as Awaited<ReturnType<typeof open>>);
Expand All @@ -72,4 +78,30 @@ describe('inbox path access', () => {
expect(readFile).not.toHaveBeenCalled();
expect(close).toHaveBeenCalledTimes(1);
});

it.each([
{ name: 'reads the matching opened file', ino: 2, expected: 'aGVsbG8=' },
{ name: 'rejects a replaced file', ino: 3, expected: null },
])('when fd aliases remain unresolved, $name', async ({ ino, expected }) => {
const readFile = vi.fn().mockResolvedValue('aGVsbG8=');
const close = vi.fn().mockResolvedValue(undefined);
mockOpen.mockResolvedValue({
fd: 42,
stat: vi.fn().mockResolvedValue(openedStat),
readFile,
close,
} as unknown as Awaited<ReturnType<typeof open>>);
mockRealpath.mockImplementation(async (path) => {
if (path === '/workspace') return '/workspace';
if (path === '/workspace/task-1/inbox') return '/workspace/task-1/inbox';
if (path === '/workspace/task-1/inbox/file.txt') return '/workspace/task-1/inbox/file.txt';
throw new Error(`unexpected path ${path}`);
});
mockRealpathSync.mockReturnValue('/dev/fd/42');
mockStat.mockResolvedValue({ ...openedStat, ino } as Awaited<ReturnType<typeof stat>>);

await expect(readInboxFile('/workspace', 'task-1/inbox/file.txt')).resolves.toBe(expected);
expect(readFile).toHaveBeenCalledTimes(expected === null ? 0 : 1);
expect(close).toHaveBeenCalledTimes(1);
});
});
3 changes: 2 additions & 1 deletion packages/desktop/test/release-scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ afterEach(() => {
describe('verify-release-version.mjs', () => {
it('verifies workspace manifest alignment in the repository', () => {
const out = runNode([verifyScript, '--check-workspace', '--root', repoRoot]);
expect(out).toContain('Workspace manifests aligned at version 0.0.16');
const { version } = JSON.parse(readFileSync(path.join(repoRoot, 'package.json'), 'utf8'));
expect(out).toContain(`version ${version}`);
});

it('validates strict SemVer tags and emits GitHub outputs for stable and prerelease tags', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawwork/pwa",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawwork/shared",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"type": "module",
"main": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clawwork/website",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"type": "module",
"scripts": {
Expand Down