mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-11-01 03:11:33 +00:00
The plugin host serves MCP without sessions, so any copy answers any request and Azure can add copies on load. opencode cancels with a message no such copy can match, so each turn gives plugins on the plugin host a token for the thread, and the app's Stop calls the host's POST /cancel with it and the license; Redis passes it to the copy running the call, whose response ends with Request cancelled. PLUGINS limits a container to some plugins, as one split out of the shared container runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
568 B
Python
21 lines
568 B
Python
import anyio
|
|
from mcp.server.mcpserver import MCPServer
|
|
|
|
|
|
def server() -> MCPServer:
|
|
slow = MCPServer("slow")
|
|
|
|
@slow.tool()
|
|
async def wait(mark: str) -> str:
|
|
"""Runs until it is stopped, writing what happened to `mark`."""
|
|
path = anyio.Path(mark)
|
|
await path.write_text("started")
|
|
try:
|
|
await anyio.sleep(60)
|
|
except anyio.get_cancelled_exc_class():
|
|
with anyio.CancelScope(shield=True):
|
|
await path.write_text("cancelled")
|
|
raise
|
|
return "done"
|
|
|
|
return slow
|