shotgun-sh 0.2.7.dev2__py3-none-any.whl → 0.2.8__py3-none-any.whl
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.
Potentially problematic release.
This version of shotgun-sh might be problematic. Click here for more details.
- shotgun/agents/agent_manager.py +31 -7
- shotgun/build_constants.py +2 -2
- shotgun/tui/screens/chat.py +6 -0
- {shotgun_sh-0.2.7.dev2.dist-info → shotgun_sh-0.2.8.dist-info}/METADATA +1 -1
- {shotgun_sh-0.2.7.dev2.dist-info → shotgun_sh-0.2.8.dist-info}/RECORD +8 -8
- {shotgun_sh-0.2.7.dev2.dist-info → shotgun_sh-0.2.8.dist-info}/WHEEL +0 -0
- {shotgun_sh-0.2.7.dev2.dist-info → shotgun_sh-0.2.8.dist-info}/entry_points.txt +0 -0
- {shotgun_sh-0.2.7.dev2.dist-info → shotgun_sh-0.2.8.dist-info}/licenses/LICENSE +0 -0
shotgun/agents/agent_manager.py
CHANGED
|
@@ -40,6 +40,7 @@ from pydantic_ai.messages import (
|
|
|
40
40
|
SystemPromptPart,
|
|
41
41
|
ToolCallPart,
|
|
42
42
|
ToolCallPartDelta,
|
|
43
|
+
UserPromptPart,
|
|
43
44
|
)
|
|
44
45
|
from textual.message import Message
|
|
45
46
|
from textual.widget import Widget
|
|
@@ -381,13 +382,12 @@ class AgentManager(Widget):
|
|
|
381
382
|
|
|
382
383
|
# Clear file tracker before each run to track only this run's operations
|
|
383
384
|
deps.file_tracker.clear()
|
|
384
|
-
# preprocess messages; maybe we need to include the user answer in the message history
|
|
385
385
|
|
|
386
|
-
|
|
386
|
+
# Don't manually add the user prompt - Pydantic AI will include it in result.new_messages()
|
|
387
|
+
# This prevents duplicates and confusion with incremental mounting
|
|
387
388
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
self._post_messages_updated()
|
|
389
|
+
# Save current message history before the run
|
|
390
|
+
original_messages = self.ui_message_history.copy()
|
|
391
391
|
|
|
392
392
|
# Start with persistent message history
|
|
393
393
|
message_history = self.message_history
|
|
@@ -555,11 +555,35 @@ class AgentManager(Widget):
|
|
|
555
555
|
},
|
|
556
556
|
)
|
|
557
557
|
|
|
558
|
-
#
|
|
559
|
-
|
|
558
|
+
# Merge agent's response messages, avoiding duplicates
|
|
559
|
+
# The TUI may have already added the user prompt, so check for it
|
|
560
|
+
new_messages = cast(
|
|
560
561
|
list[ModelRequest | ModelResponse | HintMessage], result.new_messages()
|
|
561
562
|
)
|
|
562
563
|
|
|
564
|
+
# Deduplicate: skip user prompts that are already in original_messages
|
|
565
|
+
deduplicated_new_messages = []
|
|
566
|
+
for msg in new_messages:
|
|
567
|
+
# Check if this is a user prompt that's already in original_messages
|
|
568
|
+
if isinstance(msg, ModelRequest) and any(
|
|
569
|
+
isinstance(part, UserPromptPart) for part in msg.parts
|
|
570
|
+
):
|
|
571
|
+
# Check if an identical user prompt is already in original_messages
|
|
572
|
+
already_exists = any(
|
|
573
|
+
isinstance(existing, ModelRequest)
|
|
574
|
+
and any(isinstance(p, UserPromptPart) for p in existing.parts)
|
|
575
|
+
and existing.parts == msg.parts
|
|
576
|
+
for existing in original_messages[
|
|
577
|
+
-5:
|
|
578
|
+
] # Check last 5 messages for efficiency
|
|
579
|
+
)
|
|
580
|
+
if already_exists:
|
|
581
|
+
continue # Skip this duplicate user prompt
|
|
582
|
+
|
|
583
|
+
deduplicated_new_messages.append(msg)
|
|
584
|
+
|
|
585
|
+
self.ui_message_history = original_messages + deduplicated_new_messages
|
|
586
|
+
|
|
563
587
|
# Get file operations early so we can use them for contextual messages
|
|
564
588
|
file_operations = deps.file_tracker.operations.copy()
|
|
565
589
|
self.recently_change_files = file_operations
|
shotgun/build_constants.py
CHANGED
|
@@ -12,8 +12,8 @@ POSTHOG_API_KEY = ''
|
|
|
12
12
|
POSTHOG_PROJECT_ID = '191396'
|
|
13
13
|
|
|
14
14
|
# Logfire configuration embedded at build time (only for dev builds)
|
|
15
|
-
LOGFIRE_ENABLED = '
|
|
16
|
-
LOGFIRE_TOKEN = '
|
|
15
|
+
LOGFIRE_ENABLED = ''
|
|
16
|
+
LOGFIRE_TOKEN = ''
|
|
17
17
|
|
|
18
18
|
# Build metadata
|
|
19
19
|
BUILD_TIME_ENV = "production" if SENTRY_DSN else "development"
|
shotgun/tui/screens/chat.py
CHANGED
|
@@ -690,6 +690,12 @@ class ChatScreen(Screen[None]):
|
|
|
690
690
|
# Not a command, process as normal
|
|
691
691
|
self.history.append(message.text)
|
|
692
692
|
|
|
693
|
+
# Add user message to agent_manager's history BEFORE running the agent
|
|
694
|
+
# This ensures immediate visual feedback AND proper deduplication
|
|
695
|
+
user_message = ModelRequest.user_text_prompt(text)
|
|
696
|
+
self.agent_manager.ui_message_history.append(user_message)
|
|
697
|
+
self.messages = self.agent_manager.ui_message_history.copy()
|
|
698
|
+
|
|
693
699
|
# Clear the input
|
|
694
700
|
self.value = ""
|
|
695
701
|
self.run_agent(text) # Use stripped text
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
shotgun/__init__.py,sha256=P40K0fnIsb7SKcQrFnXZ4aREjpWchVDhvM1HxI4cyIQ,104
|
|
2
2
|
shotgun/api_endpoints.py,sha256=TvxuJyMrZLy6KZTrR6lrdkG8OBtb3TJ48qaw3pWitO0,526
|
|
3
|
-
shotgun/build_constants.py,sha256=
|
|
3
|
+
shotgun/build_constants.py,sha256=hDFr6eO0lwN0iCqHQ1A5s0D68txR8sYrTJLGa7tSi0o,654
|
|
4
4
|
shotgun/logging_config.py,sha256=UKenihvgH8OA3W0b8ZFcItYaFJVe9MlsMYlcevyW1HY,7440
|
|
5
5
|
shotgun/main.py,sha256=RA3q1xPfqxCu43UmgI2ryZpA-IxPhJb_MJrbLqp9c_g,5140
|
|
6
6
|
shotgun/posthog_telemetry.py,sha256=TOiyBtLg21SttHGWKc4-e-PQgpbq6Uz_4OzlvlxMcZ0,6099
|
|
@@ -8,7 +8,7 @@ shotgun/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
8
8
|
shotgun/sentry_telemetry.py,sha256=VD8es-tREfgtRKhDsEVvqpo0_kM_ab6iVm2lkOEmTlI,2950
|
|
9
9
|
shotgun/telemetry.py,sha256=C8dM7Feo1OxJMwDvgAMaA2RyRDO2rYPvC_8kLBuRUS8,3683
|
|
10
10
|
shotgun/agents/__init__.py,sha256=8Jzv1YsDuLyNPFJyckSr_qI4ehTVeDyIMDW4omsfPGc,25
|
|
11
|
-
shotgun/agents/agent_manager.py,sha256=
|
|
11
|
+
shotgun/agents/agent_manager.py,sha256=0dIdYUNb8Vp3xcik0_FYKUwYxibpyT65oPQ5kwPmV_g,40638
|
|
12
12
|
shotgun/agents/common.py,sha256=0F_dwEc72APvbY1b-lqM9VgPYuY1GpfhjSWv5-1pCB0,19032
|
|
13
13
|
shotgun/agents/conversation_history.py,sha256=c-1PBaG9FXPfSmekWtrD6s6YVT0sd98DdDhzS4a1Hyo,7859
|
|
14
14
|
shotgun/agents/conversation_manager.py,sha256=X3DWZZIqrv0hS1SUasyoxexnLPBUrZMBg4ZmRAipkBE,4429
|
|
@@ -127,7 +127,7 @@ shotgun/tui/components/prompt_input.py,sha256=Ss-htqraHZAPaehGE4x86ij0veMjc4Ugad
|
|
|
127
127
|
shotgun/tui/components/spinner.py,sha256=ovTDeaJ6FD6chZx_Aepia6R3UkPOVJ77EKHfRmn39MY,2427
|
|
128
128
|
shotgun/tui/components/splash.py,sha256=vppy9vEIEvywuUKRXn2y11HwXSRkQZHLYoVjhDVdJeU,1267
|
|
129
129
|
shotgun/tui/components/vertical_tail.py,sha256=kROwTaRjUwVB7H35dtmNcUVPQqNYvvfq7K2tXBKEb6c,638
|
|
130
|
-
shotgun/tui/screens/chat.py,sha256=
|
|
130
|
+
shotgun/tui/screens/chat.py,sha256=v3MR0RoQOUeZ0e3W-sxBXM7eANq7ve7zCM-tkv386JA,37773
|
|
131
131
|
shotgun/tui/screens/chat.tcss,sha256=2Yq3E23jxsySYsgZf4G1AYrYVcpX0UDW6kNNI0tDmtM,437
|
|
132
132
|
shotgun/tui/screens/directory_setup.py,sha256=lIZ1J4A6g5Q2ZBX8epW7BhR96Dmdcg22CyiM5S-I5WU,3237
|
|
133
133
|
shotgun/tui/screens/feedback.py,sha256=VxpW0PVxMp22ZvSfQkTtgixNrpEOlfWtekjqlVfYEjA,5708
|
|
@@ -148,8 +148,8 @@ shotgun/utils/env_utils.py,sha256=ulM3BRi9ZhS7uC-zorGeDQm4SHvsyFuuU9BtVPqdrHY,14
|
|
|
148
148
|
shotgun/utils/file_system_utils.py,sha256=l-0p1bEHF34OU19MahnRFdClHufThfGAjQ431teAIp0,1004
|
|
149
149
|
shotgun/utils/source_detection.py,sha256=Co6Q03R3fT771TF3RzB-70stfjNP2S4F_ArZKibwzm8,454
|
|
150
150
|
shotgun/utils/update_checker.py,sha256=IgzPHRhS1ETH7PnJR_dIx6lxgr1qHpCkMTgzUxvGjhI,7586
|
|
151
|
-
shotgun_sh-0.2.
|
|
152
|
-
shotgun_sh-0.2.
|
|
153
|
-
shotgun_sh-0.2.
|
|
154
|
-
shotgun_sh-0.2.
|
|
155
|
-
shotgun_sh-0.2.
|
|
151
|
+
shotgun_sh-0.2.8.dist-info/METADATA,sha256=XzP2S-xNu3_EIDNBqLAn-VdVn_V0ljhpDZuhHXk4yL0,4294
|
|
152
|
+
shotgun_sh-0.2.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
153
|
+
shotgun_sh-0.2.8.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
|
|
154
|
+
shotgun_sh-0.2.8.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
|
|
155
|
+
shotgun_sh-0.2.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|