INNER CODE UNIT · Python
_read_workspace_diff
ApodexAI/FrontierAgent · apodex/tui/app.py:752
def _read_workspace_diff(self, journal: Any) -> None:
stats: list[tuple[str, int, int]] = []
diff_text = ""
failure = ""
try:
# One pass: the header counts and the hunks they describe have to
# come from the same read, or a file written between two passes
# makes them disagree.
stats, diff_text = journal.report()
except Exception as exc:
logger.exception("failed to build workspace diff")
failure = f"{type(exc).__name__}: {exc}"
finally:
try:
self.call_from_thread(
self._store_workspace_diff, stats, diff_text, journal,
failure,
)