diffbroker 0.12.1 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/diffbroker/agents/claude.rb +6 -1
- data/lib/diffbroker/daemon.rb +9 -2
- data/lib/diffbroker/version.rb +1 -1
- data/plugin/.claude-plugin/plugin.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bdc96c23de6492a2ea0660c7f897c8c04efc4ea3993cf96e9b4c6bf57385644
|
|
4
|
+
data.tar.gz: b1159b4577c725eb8f9a92277ccdfd84fcdf9cf655d09dbe384d70d6cc00bc75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07e7a17ef7f21c5350e7796d58b75b5255d51a7fcac5ca7f2036e86f82915f4bfaa96a2058572667279e3ffe50d85953ad224977bfbf5da50fc88eec150aa6d5
|
|
7
|
+
data.tar.gz: 7457ee92b3fbad1376448ae6be16e700a74ca4e7427a5f58aea9e713a4b09da88d4424f85201b6c95be8f1ba5f84e558f976fc570b8658a7110572e9750b0cee
|
|
@@ -30,11 +30,16 @@ module Diffbroker
|
|
|
30
30
|
def resumes? = true
|
|
31
31
|
|
|
32
32
|
def autonomous_command(task, mcp_config:)
|
|
33
|
-
args = task["read_only"] ? READ_ONLY_ARGS : @config.claude_args
|
|
33
|
+
args = task["read_only"] ? READ_ONLY_ARGS : with_diffbroker_tools(@config.claude_args)
|
|
34
34
|
[ @config.claude_command, "-p", task.fetch("prompt"), *resume(task), "--output-format", "stream-json", "--verbose", *args,
|
|
35
35
|
"--mcp-config", mcp_config, *strict(task), "--plugin-dir", @plugin_dir ]
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# In `auto` mode a classifier approves each tool call and refused Diff Broker's own report_task, so a run that fixed CI or
|
|
39
|
+
# posted comments ended with "no report". The tools of this server are allowed up front, as in the read-only runs: the
|
|
40
|
+
# task token limits what each may do. A user who sets --allowedTools themselves keeps full control of it.
|
|
41
|
+
def with_diffbroker_tools(args) = args.include?("--allowedTools") ? args : [ *args, "--allowedTools", "mcp__diffbroker__*" ]
|
|
42
|
+
|
|
38
43
|
# The permissions above are passed again: a resumed session keeps its conversation, not its sandbox.
|
|
39
44
|
def resume(task) = task["resume_session_id"] ? [ "--resume", task["resume_session_id"] ] : []
|
|
40
45
|
|
data/lib/diffbroker/daemon.rb
CHANGED
|
@@ -367,9 +367,8 @@ module Diffbroker
|
|
|
367
367
|
return unless @running_lock.synchronize { !@upgrading && @running.add?(id) } # the upgrade's restart would kill it
|
|
368
368
|
|
|
369
369
|
@state&.update(busy_tasks: @running_lock.synchronize { @running.size })
|
|
370
|
-
repositories = @repositories
|
|
371
370
|
@spawner.call do
|
|
372
|
-
@task_runner.run(message, repositories:)
|
|
371
|
+
@task_runner.run(message, repositories: known_repositories)
|
|
373
372
|
rescue StandardError => e
|
|
374
373
|
@out.puts "Task #{id} crashed: #{e.class}: #{e.message}"
|
|
375
374
|
ensure
|
|
@@ -380,6 +379,14 @@ module Diffbroker
|
|
|
380
379
|
end
|
|
381
380
|
end
|
|
382
381
|
|
|
382
|
+
# The server hands over pending tasks while the connection is still being set up, before the first scan: scan now rather
|
|
383
|
+
# than fail the task with "no checkout".
|
|
384
|
+
def known_repositories
|
|
385
|
+
@repositories = @scanner.scan if @scanned_at.nil?
|
|
386
|
+
@scanned_at ||= @clock.call
|
|
387
|
+
@repositories
|
|
388
|
+
end
|
|
389
|
+
|
|
383
390
|
# Helpers an agent left in worktrees nobody works in (rubocop --server and the like). Only while no task runs here.
|
|
384
391
|
def sweep_strays
|
|
385
392
|
return unless @reaper && @running_lock.synchronize { @running.empty? }
|
data/lib/diffbroker/version.rb
CHANGED