From 81a6126896c69bbbc0f2be638e6ae73b7f69eb5a Mon Sep 17 00:00:00 2001 From: ymq Date: Sat, 8 Aug 2026 23:11:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20monkey-patch=20handle=5Fchunk=20to=20spl?= =?UTF-8?q?it=20on=200x0a=20=E2=80=94=20no=20AgentIO=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index.ui | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/wwwroot/index.ui b/wwwroot/index.ui index f9c22a9..3cdf46f 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -81,7 +81,7 @@ "event": "changed", "actiontype": "script", "target": "self", - "script": "var v=this.getValue();var pid=(v||{}).project_id||'';if(!pid)return;fetch('/pipeline-sdlc/api/cockpit_context_update.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'project_id='+encodeURIComponent(pid)}).then(function(r){return r.json()}).then(function(r){if(r.success){var pl=bricks.getWidgetById('task_btn',bricks.app);if(pl&&pl.text_w)pl.text_w.set_text('任务');}})" + "script": "if(!bricks.HttpResponseStream._patched){\nbricks.HttpResponseStream._patched=true;\nvar orig=bricks.HttpResponseStream.prototype.handle_chunk;\nbricks.HttpResponseStream.prototype.handle_chunk=function(resp,handler){\nconsole.log('PATCHED handle_chunk');\nconst reader=resp.body.getReader();\nconst decoder=new TextDecoder('utf-8');\nlet result=await reader.read();\nvar buff_='';\nwhile(!result.done){\nconst text=decoder.decode(result.value);\nbuff_+=text;\nconst lines=buff_.split(String.fromCharCode(10));\nfor(var i=0;i