From 7ea4644f8c4853c6ab8eda6948bf447b5bbbafbb Mon Sep 17 00:00:00 2001 From: foxnne Date: Thu, 15 Oct 2026 06:41:48 -0500 Subject: [PATCH] ci: check pull requests with plugin-build-action's check.yml Calls check.yml from plugin-build-action v7 on pull requests and pushes to main; formats what zig fmt flags so it starts green. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ src/AcpClient.zig | 16 ++++++++++------ src/Explorer.zig | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..84280cd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +# Checks every pull request and every push to main: formatting, a build for each desktop OS, the +# build's `test` step if it has one, and (never failing the run) a build against fizzy main. +name: CI +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + uses: fizzyedit/plugin-build-action/.github/workflows/check.yml@v7 + with: + zig-version: "0.16.0" + # secrets: + # build_env: ${{ secrets.MY_BUILD_ENV }} # as in release.yml, if the build needs one diff --git a/src/AcpClient.zig b/src/AcpClient.zig index 8e2cf12..bfdbe24 100644 --- a/src/AcpClient.zig +++ b/src/AcpClient.zig @@ -838,12 +838,16 @@ fn askPermission(s: *Session, id: json.Value, params: json.Value) void { }; const title = str(field(callv, "title")) orelse "use a tool"; const m = turnMessage(s) orelse return rid.deinit(s.gpa); - const r = call("chat.ask", api.Ask{ .chat = s.chat, .message = m, .question = .{ - // On its tool's line the call says what; on its own the question does. - .text = if (tid != null) "" else std.fmt.allocPrint(arena, "The agent asks to {s}.", .{readable(arena, title)}) catch "", - .options = options.items, - .tool = tid, - } }) orelse return rid.deinit(s.gpa); + const r = call("chat.ask", api.Ask{ + .chat = s.chat, + .message = m, + .question = .{ + // On its tool's line the call says what; on its own the question does. + .text = if (tid != null) "" else std.fmt.allocPrint(arena, "The agent asks to {s}.", .{readable(arena, title)}) catch "", + .options = options.items, + .tool = tid, + }, + }) orelse return rid.deinit(s.gpa); const asked = api.parse(api.Asked, arena, r) catch return rid.deinit(s.gpa); s.requests.put(s.gpa, asked.question, rid) catch rid.deinit(s.gpa); } diff --git a/src/Explorer.zig b/src/Explorer.zig index da48e0b..961e896 100644 --- a/src/Explorer.zig +++ b/src/Explorer.zig @@ -83,7 +83,7 @@ pub fn newPath(host: *sdk.Host, client: []const u8, folder: []const u8) ![]u8 { var n: u32 = 0; const path = while (true) : (n += 1) { const name = try std.fmt.bufPrint(&name_buf, "{d:0>4}-{d:0>2}-{d:0>2}-{d:0>2}{d:0>2}{d:0>2}{s}.chat", .{ - ymd.year, md.month.numeric(), md.day_index + 1, t.getHoursIntoDay(), t.getMinutesIntoHour(), t.getSecondsIntoMinute(), + ymd.year, md.month.numeric(), md.day_index + 1, t.getHoursIntoDay(), t.getMinutesIntoHour(), t.getSecondsIntoMinute(), if (n == 0) "" else try std.fmt.bufPrint(name_buf[48..], "-{d}", .{n}), }); const p = try std.fs.path.join(gpa, &.{ client_dir, name });