Skip to content

ThreadItemFileChange

Base classes

Name Children Inherits
BaseThreadItem
codexed.models.thread_item
Base class for thread items.

⋔ Inheritance diagram

graph TD
  2432533005["thread_item.ThreadItemFileChange"]
  2083311648["thread_item.BaseThreadItem"]
  3116041069["base.CodexBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2083311648 --> 2432533005
  3116041069 --> 2083311648
  3879467795 --> 3116041069
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseThreadItem

File change item.

Source code in src/codexed/models/thread_item.py
class ThreadItemFileChange(BaseThreadItem):
    """File change item."""

    type: Literal["fileChange"] = "fileChange"
    changes: list[FileUpdateChange]
    status: PatchApplyStatus

    @property
    def inferred_arguments(self) -> dict[str, Any]:
        return {"changes": [c.model_dump() for c in self.changes]}

    @property
    def item_summary(self) -> str:
        """Human-readable summary of file changes."""
        paths = [c.path for c in self.changes]
        if len(paths) > 3:  # noqa: PLR2004
            return f"[Files: {', '.join(paths[:3])} +{len(paths) - 3} more]"
        return f"[Files: {', '.join(paths)}]"

item_summary property

item_summary: str

Human-readable summary of file changes.

:fa-brands-github: Show source on GitHub