tools.meme_tool module
Meme tool — injects a fake tool name into the response header.
Stargazer calls this tool with any arbitrary string, and that string
appears in the [`model` :: ... :: `tool_names`] header bracket as
though it were a real tool that was executed. The postprocessor picks
up the name from ctx.tools_executed and renders it verbatim.
Creative usage is encouraged: defensive obfuscation (classified_op,
engage_countermeasures), trolling (lmao_imagine,
cope_and_seethe), vibes (caress_the_void,
weave_starlight), or pure chaos (ą̴̛̜̗b̸̡̖̱y̶̢̨̤s̷̰̜̓s).
There are no rules. Be feral.
- async tools.meme_tool.run(name, ctx=None)[source]
Inject a fake tool name into the response header’s tool-call list.
The sole handler for the
meme_tooltool. It does not perform any real work or external action; its only effect is to append a caller-supplied string toctx.tools_executedso that, when the postprocessor assembles the[`model` :: ... :: `tool_names`]bracket header, the fake name appears alongside genuinely executed tools. This powers obfuscation, trolling, and aesthetic flourishes in the header without any underlying capability.Before appending it sanitizes the input with the module-level
_HEADER_UNSAFEregex, stripping backticks, square brackets, and angle brackets that would otherwise break the delimited header structure. The only side effect is mutating thectx.tools_executedlist in place; if no context (or no such attribute) is available it no-ops and says so. BecauseTOOL_NO_BACKGROUNDis set the call runs inline so the name is present before the header is built, andTOOL_ALLOW_REPEATlets multiple calls in one turn stack several names.Discovered via the single-tool
TOOL_NAME/runmodule format and bound as the handler bytool_loader(getattr(module, "run")); dispatched by the tool registry when the model callsmeme_tool, with no direct internal callers.- Parameters:
name (
str) – The fake tool name to inject (any string; sanitized of header-unsafe characters before use).ctx – The tool context; its
tools_executedlist is appended to when present.
- Returns:
A short status message confirming the injected name, an error when the name is empty or contained only header-unsafe characters, or a note that no context was available to inject into.
- Return type: