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

Function _coerce

src/command_system/tasks_command.py:26–30  ·  view source on GitHub ↗

Defensive: a ``.value``-bearing object → its ``.value``, else the value unchanged. ``TaskType``/``TaskStatus`` are ``Literal[str]`` today (already plain strings, so this just passes them through) — this only future-proofs against an enum/wrapper.

(x: Any)

Source from the content-addressed store, hash-verified

24
25
26def _coerce(x: Any) -> Any:
27 """Defensive: a ``.value``-bearing object → its ``.value``, else the value unchanged.
28 ``TaskType``/``TaskStatus`` are ``Literal[str]`` today (already plain strings, so this
29 just passes them through) — this only future-proofs against an enum/wrapper."""
30 return getattr(x, "value", x)
31
32
33def _format_task(t: Any) -> str:

Callers 1

_format_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected