brainiac-fizzy 0.0.3 → 0.0.5
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/brainiac/plugins/fizzy/config.rb +13 -6
- data/lib/brainiac/plugins/fizzy/handlers/assignment.rb +23 -17
- data/lib/brainiac/plugins/fizzy/handlers/comments.rb +5 -5
- data/lib/brainiac/plugins/fizzy/prompts.rb +4 -1
- data/lib/brainiac/plugins/fizzy/version.rb +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: 52b33b796dafe9d47fe9db8f881537d2d66bda2f54f51f1bafb9dd4a4b188a4c
|
|
4
|
+
data.tar.gz: '0260149a3b2daa8439049b9369980f1edf73f65226cb07785f7f0c954e74dc66'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2fc7f43f8c505d94fc7f4364cb24d33d9aee11d23e6a73033df82e5fd6ad4b4aa496348df42fcac455ba71d75d7d66b3cea76b458f3cb5b0f544682427e5f4a5
|
|
7
|
+
data.tar.gz: 6bb9c239037adde4e1f371eb7087501ee9233ac32177ca2997aad0a4926b4e9db217d0b06dd49e2384fab3cb4a27de01b7491af32afcf121a536e68e7ab5a773
|
|
@@ -63,15 +63,22 @@ module Brainiac
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def board_key_for_project(project_config)
|
|
66
|
+
# Priority 1: explicit fizzy_board in project config (board key name from fizzy.json)
|
|
67
|
+
board_key = project_config["fizzy_board"]
|
|
68
|
+
return board_key if board_key && @boards.key?(board_key)
|
|
69
|
+
|
|
70
|
+
# Priority 2: .fizzy.yaml in the repo directory
|
|
66
71
|
fizzy_yaml = File.join(project_config["repo_path"], ".fizzy.yaml")
|
|
67
|
-
|
|
72
|
+
if File.exist?(fizzy_yaml)
|
|
73
|
+
require "yaml"
|
|
74
|
+
data = YAML.safe_load_file(fizzy_yaml)
|
|
75
|
+
board_id = data["board"]
|
|
76
|
+
return board_key_for_id(board_id)
|
|
77
|
+
end
|
|
68
78
|
|
|
69
|
-
|
|
70
|
-
data = YAML.safe_load_file(fizzy_yaml)
|
|
71
|
-
board_id = data["board"]
|
|
72
|
-
board_key_for_id(board_id)
|
|
79
|
+
nil
|
|
73
80
|
rescue StandardError => e
|
|
74
|
-
LOG.warn "[Fizzy] Could not
|
|
81
|
+
LOG.warn "[Fizzy] Could not resolve board for project: #{e.message}" if defined?(LOG)
|
|
75
82
|
nil
|
|
76
83
|
end
|
|
77
84
|
|
|
@@ -67,28 +67,34 @@ end
|
|
|
67
67
|
|
|
68
68
|
def react_to_assignment(card_number, repo_path, agent_name)
|
|
69
69
|
Thread.new do
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
env = fizzy_env_for(agent_name)
|
|
71
|
+
|
|
72
|
+
# Best-effort cleanup of existing reactions from this agent
|
|
73
|
+
begin
|
|
74
|
+
result = run_cmd("fizzy", "reaction", "list", "--card", card_number.to_s,
|
|
75
|
+
chdir: repo_path, env: env)
|
|
76
|
+
reactions = JSON.parse(result)["data"] || []
|
|
77
|
+
|
|
78
|
+
identity_output = run_cmd("fizzy", "identity", "show", chdir: repo_path, env: env)
|
|
79
|
+
current_user_id = JSON.parse(identity_output).dig("data", "accounts", 0, "user", "id")
|
|
80
|
+
|
|
81
|
+
if current_user_id
|
|
82
|
+
reactions.each do |reaction|
|
|
83
|
+
if reaction.dig("reacter", "id") == current_user_id
|
|
84
|
+
run_cmd("fizzy", "reaction", "delete", reaction["id"], "--card", card_number.to_s,
|
|
85
|
+
chdir: repo_path, env: env)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
84
88
|
end
|
|
89
|
+
rescue StandardError => e
|
|
90
|
+
LOG.warn "Could not clean up existing reactions on card ##{card_number}: #{e.message}"
|
|
85
91
|
end
|
|
86
92
|
|
|
87
|
-
#
|
|
93
|
+
# Always attempt to add the reaction even if cleanup failed
|
|
88
94
|
run_cmd("fizzy", "reaction", "create", "--card", card_number.to_s,
|
|
89
|
-
"--content", "
|
|
95
|
+
"--content", "👀", chdir: repo_path, env: env)
|
|
90
96
|
rescue StandardError => e
|
|
91
|
-
LOG.warn "Could not add reaction to card: #{e.message}"
|
|
97
|
+
LOG.warn "Could not add reaction to card ##{card_number}: #{e.message}"
|
|
92
98
|
end
|
|
93
99
|
end
|
|
94
100
|
|
|
@@ -488,10 +488,10 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
488
488
|
effort = detect_effort(ctx.project_config, tags: card_tags, text: ctx.plain_text)
|
|
489
489
|
|
|
490
490
|
is_worktree = work_dir != ctx.project_config["repo_path"]
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
should_resume = is_worktree && resume_viable?(
|
|
492
|
+
project_config: ctx.project_config, cli_provider: ctx.cli_provider_override,
|
|
493
|
+
agent_name: ctx.agent_name, chdir: work_dir
|
|
494
|
+
)
|
|
495
495
|
|
|
496
496
|
prompt = if should_resume
|
|
497
497
|
LOG.info "[Resume] Using lean prompt for follow-up on card #{card_number || ctx.card_internal_id}"
|
|
@@ -508,7 +508,7 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
508
508
|
log_name: "followup-#{card_number || ctx.card_internal_id}",
|
|
509
509
|
model: ctx.model, effort: effort, agent_name: ctx.agent_name,
|
|
510
510
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
511
|
-
source: :fizzy, cli_provider: ctx.cli_provider_override, resume:
|
|
511
|
+
source: :fizzy, cli_provider: ctx.cli_provider_override, resume: should_resume,
|
|
512
512
|
source_context: {
|
|
513
513
|
card_number: card_number, card_internal_id: ctx.card_internal_id,
|
|
514
514
|
deploy_intent: ctx.deploy_intent
|
|
@@ -71,7 +71,10 @@ module Brainiac
|
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
Focus your response on the comment above. If you've already addressed this in a previous session, reply confirming it's done.
|
|
74
|
-
Otherwise, make the requested changes, commit,
|
|
74
|
+
Otherwise, make the requested changes, commit, and push.
|
|
75
|
+
|
|
76
|
+
**Response destination: Post your response as a comment on Fizzy card #{{CARD_NUMBER}}.**
|
|
77
|
+
Do NOT post comments on the GitHub PR — this conversation is happening on the card.
|
|
75
78
|
PROMPT
|
|
76
79
|
|
|
77
80
|
FOLLOWUP_NO_WORKTREE = <<~PROMPT
|