MCPcopy
hub / github.com/crewAIInc/crewAI / _entry_id

Function _entry_id

lib/cli/src/crewai_cli/checkpoint_tui.py:88–101  ·  view source on GitHub ↗

Normalize an entry's name into its checkpoint ID. JSON filenames are ``{ts}_{uuid}_p-{parent}.json``; SQLite IDs are already ``{ts}_{uuid}``. This strips the JSON suffix so fork-parent lookups work in both providers.

(entry: dict[str, Any])

Source from the content-addressed store, hash-verified

86
87
88def _entry_id(entry: dict[str, Any]) -> str:
89 """Normalize an entry's name into its checkpoint ID.
90
91 JSON filenames are ``{ts}_{uuid}_p-{parent}.json``; SQLite IDs
92 are already ``{ts}_{uuid}``. This strips the JSON suffix so
93 fork-parent lookups work in both providers.
94 """
95 name = str(entry.get("name", ""))
96 if name.endswith(".json"):
97 name = name[: -len(".json")]
98 idx = name.find("_p-")
99 if idx != -1:
100 name = name[:idx]
101 return name
102
103
104def _build_progress_bar(completed: int, total: int, width: int = 20) -> str:

Callers 1

_add_checkpointMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…