mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 14:17:11 +08:00
fix(steer): keep steer button clickable during active task and log injected instruction
This commit is contained in:
@@ -368,6 +368,7 @@ class AgentBridge:
|
||||
|
||||
def steer_session(self, session_id: str, instruction: str):
|
||||
"""Inject an explicit instruction into one active session."""
|
||||
logger.info(f"[AgentBridge] steer new instruction: session={session_id}, content={instruction}")
|
||||
return get_steer_registry().submit(session_id, instruction)
|
||||
|
||||
def get_agent(self, session_id: str = None) -> Optional[Agent]:
|
||||
|
||||
@@ -1775,10 +1775,13 @@ function resetSendBtnSendMode() {
|
||||
}
|
||||
|
||||
function updateSteerBtnState() {
|
||||
// Keep the steer button enabled whenever a task is running so users can
|
||||
// fire successive guidance. Empty-input is guarded in steerActiveTask,
|
||||
// avoiding a jarring disabled/not-allowed state right after each steer.
|
||||
const active = sendBtnMode === 'cancel' && !!activeRequestId;
|
||||
steerBtn.classList.toggle('hidden', !active);
|
||||
steerBtn.classList.toggle('flex', active);
|
||||
steerBtn.disabled = !active || uploadingCount > 0 || !chatInput.value.trim();
|
||||
steerBtn.disabled = !active || uploadingCount > 0;
|
||||
}
|
||||
|
||||
function steerActiveTask() {
|
||||
|
||||
Reference in New Issue
Block a user