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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93366baf36d2624668bda7070960557ef337a5699c80be427798638386adcdda
4
- data.tar.gz: 0013377ed45686039a4f4eeeae00c995844fdea592a885dfae774d6c1ba9812c
3
+ metadata.gz: 5bdc96c23de6492a2ea0660c7f897c8c04efc4ea3993cf96e9b4c6bf57385644
4
+ data.tar.gz: b1159b4577c725eb8f9a92277ccdfd84fcdf9cf655d09dbe384d70d6cc00bc75
5
5
  SHA512:
6
- metadata.gz: 78525e73d46c72bc944a63181b1e86bf774d12d7273d81010a1024b0ea17012f601ff208d3bbbd7d34b3992dd8ddfbeff1d0471abaadf691f047e9411fe5f54f
7
- data.tar.gz: 3e74c23e1d5091235d00482aa790af5a9b40af3263ff7caf9b5c03e8f9cccee2f1e0c65a5b66ddd15a91353ebfc589e0bf768db9210a2d481a7c1426dc998c7b
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
 
@@ -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? }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Diffbroker
4
- VERSION = "0.12.1"
4
+ VERSION = "0.12.3"
5
5
  end
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "diffbroker",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "Skills for working on Diff Broker agent tasks: the diffbroker MCP tools, write rules and report_task."
5
5
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffbroker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Sidorov (@newstler)