brainiac-fizzy 0.0.41 → 0.0.42

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: 34d74e28e366e35990e7e5108ed1a129b291dcdfdb84cb331db34564fd98e511
4
- data.tar.gz: d19f01e2606a50189fec1e9954366aaa48662e12f407400c9c5326c1acb13545
3
+ metadata.gz: bd5840ff8112c851eff8400d9be4fd1bd3b1233dbdfc663a92a6d274a43e41a0
4
+ data.tar.gz: 938965e69f73c101d85f68ac7d9832e8f036155cbcc8967d473056177966a53c
5
5
  SHA512:
6
- metadata.gz: 893db09393540283fe000debd1c281c7ee9e14928cd538bd1bf9a5d72aff5dca9db7d0ef79f3f3aa2df4a8adc637b8f01ec762cd621fad691ba927605fad71a6
7
- data.tar.gz: 5115d36c013e2415604df82920076ea297284d5f27c19cecfaf3264c5d5af57d4df7272d2902b79a5dad2d01172ac2bc90338263bfa3bace8b7a7c2ffd9c5a56
6
+ metadata.gz: 1fefa175a1bcab72083fec372845a1872445de3b83fadc2ae1d8f038c88ec6451c30acb8fc06421fd691b4f808d5587be671b01b5a175bcdaabfd633e758219d
7
+ data.tar.gz: 8c06a60d5741a63c73b10dd1ac5ffd0494486632451b1a929e60de241a85ad566f0ed978be7a4f9dfc98bb1eccbd28824795b4d52a77233ed4c9b327d8402aa5
@@ -40,14 +40,17 @@ def handle_card_assigned(payload, board_key: nil)
40
40
  return [200, { status: "ignored", reason: "session already active" }.to_json]
41
41
  end
42
42
 
43
+ # Model tags resolve against the provider that will run (a cli:X chip), not the default's map.
44
+ initial_cli = detect_cli_provider(tags: tags)
45
+ initial_model, initial_model_explicit = detect_model_explicit(project_config, tags: tags, cli_provider_override: initial_cli,
46
+ agent_name: assigned_agent)
47
+
43
48
  LOG.info "Card ##{card_number} assigned to #{assigned_agent} for project '#{project_key}', " \
44
- "creating worktree: #{branch} (model: #{detect_model(project_config, tags: tags) || "default"})"
49
+ "creating worktree: #{branch} (model: #{initial_model || "default"})"
45
50
 
46
51
  react_to_assignment(card_number, repo_path, assigned_agent)
47
52
  worktree_path = setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, assigned_agent, board_key: board_key)
48
53
 
49
- initial_cli = detect_cli_provider(tags: tags)
50
- initial_model, initial_model_explicit = detect_model_explicit(project_config, tags: tags)
51
54
  initial_effort = detect_effort(project_config, tags: tags)
52
55
  # Profile ([profile:X]/[p:X]) can be specified inline in the card title OR as a
53
56
  # card tag (a `p:k+`/`profile:k+` chip, or a bare chip matching a known profile).
@@ -59,12 +62,13 @@ def handle_card_assigned(payload, board_key: nil)
59
62
  end
60
63
 
61
64
  # Persist initial overrides from card tags to the work item (profile included, so
62
- # later comments without a [p:X] keep using it).
65
+ # later comments without a [p:X] keep using it). Only a tagged model is persisted;
66
+ # the project default must not get pinned to the card.
63
67
  profile_kwargs = work_item_overrides_support_profile? ? { inline_profile: initial_profile } : {}
64
68
  resolve_work_item_overrides(
65
69
  branch: branch,
66
70
  inline_cli_provider: initial_cli,
67
- inline_model: initial_model,
71
+ inline_model: (initial_model if initial_model_explicit),
68
72
  inline_effort: initial_effort,
69
73
  **profile_kwargs
70
74
  )
@@ -109,15 +109,16 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
109
109
  card_tags = eventable.dig("card", "tags") || []
110
110
  clean_text = tags[:clean_text]
111
111
 
112
+ branch = card_info["branch"] if card_info.is_a?(Hash)
112
113
  inline_cli = detect_cli_provider(text: plain_text, tags: card_tags)
113
- inline_model, inline_model_explicit = detect_model_explicit(project_config, text: plain_text, tags: card_tags)
114
+ inline_model, inline_model_explicit = detect_comment_model(project_config, plain_text, card_tags,
115
+ inline_cli: inline_cli, branch: branch, agent_name: agent_name)
114
116
  inline_effort = detect_effort(project_config, tags: card_tags, text: plain_text)
115
117
  inline_profile = detect_comment_profile(plain_text, card_tags, tags)
116
118
 
117
119
  # Resolve overrides against the work item — merges stored overrides with inline tags
118
120
  # and persists any new inline tags for future dispatches. The profile is sticky too:
119
121
  # a [p:k+] comment keeps later untagged comments on k+ until a different [p:X].
120
- branch = card_info["branch"] if card_info.is_a?(Hash)
121
122
  if branch
122
123
  profile_kwargs = work_item_overrides_support_profile? ? { inline_profile: inline_profile } : {}
123
124
  resolved = resolve_work_item_overrides(
@@ -162,6 +163,20 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
162
163
  )
163
164
  end
164
165
 
166
+ # Resolve a [model] tag against the CLI provider that will actually run this comment
167
+ # (inline [cli:X], else the work item's sticky provider, else the agent/project default).
168
+ # Model maps are per provider: [sonnet] is claude-sonnet-4.6 under kiro but `sonnet`
169
+ # under claude, and run_agent drops any ID the running provider doesn't know.
170
+ #
171
+ # Returns [model, explicit]. The model is nil unless a tag matched, so an untagged
172
+ # comment falls through to the work item's stored model instead of the project default.
173
+ def detect_comment_model(project_config, plain_text, card_tags, inline_cli:, branch:, agent_name:)
174
+ model_cli = inline_cli || (work_item_overrides_for(branch: branch)["cli_provider"] if branch)
175
+ model, explicit = detect_model_explicit(project_config, text: plain_text, tags: card_tags,
176
+ cli_provider_override: model_cli, agent_name: agent_name)
177
+ [explicit ? model : nil, explicit]
178
+ end
179
+
165
180
  # Older core builds' resolve_work_item_overrides has no inline_profile: keyword.
166
181
  def work_item_overrides_support_profile?
167
182
  method(:resolve_work_item_overrides).parameters.any? { |t, n| t == :key && n == :inline_profile }
@@ -104,7 +104,8 @@ module Brainiac
104
104
  def dispatch_summarize_agent(card_number, card_title, branch, agent_name, project_config, worktree_path,
105
105
  overrides: {})
106
106
  prompt = render_prompt(Prompts::SUMMARIZE_WORK,
107
- { "CARD_NUMBER" => card_number, "CARD_TITLE" => card_title, "BRANCH" => branch },
107
+ { "CARD_NUMBER" => card_number, "CARD_ID" => card_number, "CARD_TITLE" => card_title,
108
+ "BRANCH" => branch },
108
109
  brain_context: "", agent_name: agent_name, channel: :fizzy,
109
110
  board_key: Config.board_key_for_project(project_config))
110
111
 
@@ -351,7 +351,7 @@ module Brainiac
351
351
  card_title = card_info["title"] || ctx[:pr_title]
352
352
 
353
353
  prompt = render_prompt(Prompts::UAT_TESTING,
354
- { "CARD_NUMBER" => card_number, "CARD_TITLE" => card_title,
354
+ { "CARD_NUMBER" => card_number, "CARD_ID" => card_number, "CARD_TITLE" => card_title,
355
355
  "PR_NUMBER" => ctx[:pull_request]["number"].to_s },
356
356
  brain_context: build_brain_context(agent_name: agent_name, card_number: card_number,
357
357
  card_title: card_title, project_key: project_key),
@@ -117,6 +117,9 @@ module Brainiac
117
117
  - Check your memory file for context on what's already been discussed/decided
118
118
 
119
119
  If you've already addressed what's being asked, reply confirming it's done.
120
+
121
+ **Response destination: Post your response as a comment on this Fizzy card.**
122
+ Anything you only print to stdout is never seen.
120
123
  PROMPT
121
124
 
122
125
  MENTION = <<~PROMPT
@@ -124,6 +127,9 @@ module Brainiac
124
127
  You are on branch "{{BRANCH}}" in a dedicated worktree.
125
128
 
126
129
  Investigate the codebase and respond accordingly.
130
+
131
+ **Response destination: Post your response as a comment on this Fizzy card.**
132
+ Anything you only print to stdout is never seen.
127
133
  PROMPT
128
134
 
129
135
  CROSS_AGENT_REVIEW = <<~'PROMPT'
@@ -138,6 +144,9 @@ module Brainiac
138
144
  You are in your own worktree at `{{WORKTREE_PATH}}` on branch `{{BRANCH}}`.
139
145
  Respond to what's being asked — code review, opinion, debugging help, or sanity check.
140
146
 
147
+ **Response destination: Post your response as a comment on Fizzy card #{{CARD_NUMBER}}.**
148
+ Anything you only print to stdout is never seen.
149
+
141
150
  **IMPORTANT: Do NOT @mention any other agents in your response.**
142
151
  PROMPT
143
152
 
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Fizzy
6
- VERSION = "0.0.41"
6
+ VERSION = "0.0.42"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-fizzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.41
4
+ version: 0.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis