MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / run

Method run

src/command_system/tasks_command.py:44–62  ·  view source on GitHub ↗
(self, args: str, context: CommandContext)

Source from the content-addressed store, hash-verified

42 pattern); ``run()`` returns text without touching ``ctx.ui``."""
43
44 async def run(self, args: str, context: CommandContext) -> InteractiveOutcome:
45 tc = getattr(context, "tool_context", None)
46 registry = getattr(tc, "runtime_tasks", None) if tc is not None else None
47 if registry is None:
48 # SDK / listing surfaces have no live task registry.
49 return InteractiveOutcome(
50 message="Background tasks are unavailable on this surface.",
51 display="system",
52 )
53 try:
54 tasks = list(registry.all())
55 except Exception:
56 tasks = []
57 if not tasks:
58 return InteractiveOutcome(message="No background tasks.", display="system")
59 lines = [f"• {_format_task(t)}" for t in tasks]
60 return InteractiveOutcome(
61 message="Background tasks:\n" + "\n".join(lines), display="system"
62 )
63
64
65TASKS_COMMAND = TasksCommand(

Callers

nothing calls this directly

Calls 4

InteractiveOutcomeClass · 0.85
_format_taskFunction · 0.85
allMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected