Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
fix(plugin): crawlee Literal -> str + twitter_send output flatten
trohitgf3528ff1a245
diff --git a/server/nodes/scraper/crawlee_scraper.py b/server/nodes/scraper/crawlee_scraper.pyindex e0bc574c..ec6988c1 100644--- a/server/nodes/scraper/crawlee_scraper.py+++ b/server/nodes/scraper/crawlee_scraper.py@@ -170,10 +170,9 @@ async def _run_playwright(url, pages, p, proxy_config, css_selector, extract_linclass CrawleeScraperParams(BaseModel):url: str = Field(default="")- crawler_type: Literal["beautifulsoup", "playwright", "adaptive"] = Field(- default="beautifulsoup", alias="crawlerType",- )- mode: Literal["single", "crawl"] = "single"+ # Pre-refactor: unknown crawler_type / mode -> handler error.+ crawler_type: str = Field(default="beautifulsoup", alias="crawlerType")+ mode: str = Field(default="single")css_selector: str = Field(default="", alias="cssSelector")extract_links: bool = Field(default=False, alias="extractLinks")max_pages: int = Field(default=10, alias="maxPages", ge=1, le=1000)diff --git a/server/nodes/twitter/twitter_send.py b/server/nodes/twitter/twitter_send.pyindex 74f97160..d39aca66 100644--- a/server/nodes/twitter/twitter_send.py+++ b/server/nodes/twitter/twitter_send.py@@ -26,8 +26,12 @@ class TwitterSendParams(BaseModel):class TwitterSendOutput(BaseModel):+ # Pre-refactor: response fields (id, text, ...) land at the top+ # level of the envelope, not under a `data` wrapper. Declared as+ # Optional[str] so Pydantic doesn't complain when they're absent.action: Optional[str] = None- data: Optional[dict] = None+ id: Optional[str] = None+ text: Optional[str] = Nonemodel_config = ConfigDict(extra="allow")@@ -39,7 +43,8 @@ async def _do_send(client, action: str, p: dict, node_id: str, ctx_raw: dict) ->raise RuntimeError("Tweet text is required")result = await asyncio.to_thread(client.posts.create, body={"text": text[:280]})await track_twitter_usage(node_id, "tweet", 1, ctx_raw)- return TwitterSendOutput(action="tweet_sent", data=format_response(result))+ resp = format_response(result)+ return TwitterSendOutput(action="tweet_sent", **(resp if isinstance(resp, dict) else {}))if action == "reply":text = p.get("text", "")@@ -51,7 +56,8 @@ async def _do_send(client, action: str, p: dict, node_id: str, ctx_raw: dict) ->body={"text": text[:280], "reply": {"in_reply_to_tweet_id": reply_to}},)await track_twitter_usage(node_id, "reply", 1, ctx_raw)- return TwitterSendOutput(action="reply_sent", data=format_response(result))+ resp = format_response(result)+ return TwitterSendOutput(action="reply_sent", **(resp if isinstance(resp, dict) else {}))tweet_id = p.get("tweetId") or p.get("tweet_id")if not tweet_id: