feat: add official Codex skill and harden task execution
Install and update artemis-use with task diagnostics and plugin guidance. Preserve cross-device file receipts, review canonical reports, guard stage transitions and reduce small history summaries. Improve exploration lifecycle, request recovery and browser live connections.
This commit is contained in:
1 parent
2328a4df0c
commit
e1ea099592
128 files changed
+4944
-700
No files matched your search
+13
-2
@@ -21,7 +21,8 @@ class ToolExecutor:
|
||||
"""One shared tool loop; synchronous legacy HTTP calls cannot block the UI.
|
||||
|
||||
Device clients keep their loop affinity across MCP connections. Cancellation
|
||||
propagates to the tool coroutine instead of abandoning a thread per request.
|
||||
propagates to async tools; dispatched synchronous writes may finish in their
|
||||
worker thread, so callers must resolve the original request rather than retry it.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -45,7 +46,17 @@ class ToolExecutor:
|
||||
async def invoke(self, fn, *args, **kwargs):
|
||||
if self.loop is None or not self.loop.is_running():
|
||||
raise RuntimeError("ARTEMIS 主程序正在启动或关闭,请稍后重试。")
|
||||
future = asyncio.run_coroutine_threadsafe(fn(*args, **kwargs), self.loop)
|
||||
|
||||
async def dispatch():
|
||||
if inspect.iscoroutinefunction(fn):
|
||||
return await fn(*args, **kwargs)
|
||||
# Legacy tools use synchronous HTTP to call this same web service.
|
||||
# Execute them off both event loops, and never call them speculatively
|
||||
# to discover whether their return value is awaitable.
|
||||
result = await asyncio.to_thread(fn, *args, **kwargs)
|
||||
return await result if inspect.isawaitable(result) else result
|
||||
|
||||
future = asyncio.run_coroutine_threadsafe(dispatch(), self.loop)
|
||||
return await asyncio.wrap_future(future)
|
||||
|
||||
async def stop(self):
|
||||
|
||||
Reference in new issue
Block a user