brainiac-discord 0.0.21 → 0.0.22
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/discord/message.rb +14 -2
- data/lib/brainiac/plugins/discord/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: 0c4e465a488b1eb8ff21dc46d539271cd85a35086fbed35a32e49bad609ee949
|
|
4
|
+
data.tar.gz: 5095805d24f0422c6ad9fe0ea7bb363965732b6d2b6df047d00295ce14b05194
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8c98fba862167e6c12096161dfb5fd964b12c6cb938c767279b00c2002a0770993c0f3a68b6b9f35fd391fbecba83d19f6fb21b1d1972a05aad4adcd89c78ff
|
|
7
|
+
data.tar.gz: 37d9072132b6c961f15c7237f9b5bae98db6ddf0933f39ea9bfee4c9b983a85eb8b007e6cf2b11d8fc19fe75c261f733429cbad1827d124c4c47cbdaa811147e
|
|
@@ -714,8 +714,15 @@ module Brainiac
|
|
|
714
714
|
end
|
|
715
715
|
|
|
716
716
|
def resolve_overrides(clean_content, project_config, thread_model, thread_effort, thread_cli_provider)
|
|
717
|
-
|
|
717
|
+
inline_cli = detect_cli_provider(text: clean_content)
|
|
718
|
+
cli_provider = inline_cli || thread_cli_provider
|
|
718
719
|
has_explicit_model = explicit_model_tag?(clean_content, project_config, cli_provider_override: cli_provider)
|
|
720
|
+
|
|
721
|
+
# The stored model is a resolved ID from the previous provider's model map, so it
|
|
722
|
+
# means nothing to a different provider. Drop it on a switch and fall back to the
|
|
723
|
+
# new provider's default (unless this message also carries a model tag).
|
|
724
|
+
# Effort is kept: it's generic and gets clamped per provider anyway.
|
|
725
|
+
thread_model = nil if provider_switched?(inline_cli, thread_cli_provider)
|
|
719
726
|
has_explicit_effort = clean_content.match?(/\[effort:\w+\]/i)
|
|
720
727
|
|
|
721
728
|
model = if has_explicit_model
|
|
@@ -737,6 +744,10 @@ module Brainiac
|
|
|
737
744
|
[model, effort, cli_provider]
|
|
738
745
|
end
|
|
739
746
|
|
|
747
|
+
def provider_switched?(inline_cli, prev_cli_provider)
|
|
748
|
+
!inline_cli.nil? && inline_cli != prev_cli_provider
|
|
749
|
+
end
|
|
750
|
+
|
|
740
751
|
# Persist inline overrides to the thread map (and work item map if a work item exists).
|
|
741
752
|
# Only writes when a new inline tag was detected (differs from previously stored values).
|
|
742
753
|
def persist_overrides(thread_map_key, clean_content, project_config,
|
|
@@ -761,7 +772,8 @@ module Brainiac
|
|
|
761
772
|
entry = map[thread_map_key]
|
|
762
773
|
if entry
|
|
763
774
|
entry["cli_provider"] = cli_provider if inline_cli
|
|
764
|
-
|
|
775
|
+
# Clear the old provider's model on a switch so it can't resurface later
|
|
776
|
+
entry["model"] = inline_model if inline_model || provider_switched?(inline_cli, prev_cli_provider)
|
|
765
777
|
entry["effort"] = effort if inline_effort
|
|
766
778
|
Config.save_thread_map(map)
|
|
767
779
|
end
|