Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tiptop/perception/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@cache
def load_prompt(prompt_name: str) -> str:
"""Load a prompt template from the prompts directory."""
return (_PROMPTS_DIR / f"{prompt_name}.txt").read_text().strip()
return (_PROMPTS_DIR / f"{prompt_name}.txt").read_text(encoding="utf-8").strip()


@cache
Expand Down
10 changes: 6 additions & 4 deletions tiptop/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _get_git_root() -> Path:
["git", "rev-parse", "--show-toplevel"],
cwd=Path(__file__).parent,
stderr=subprocess.DEVNULL,
text=True,
encoding="utf-8",
).strip())


Expand All @@ -49,13 +49,14 @@ def _collect_git_info() -> dict:
["git", "rev-parse", "HEAD"],
cwd=root,
stderr=subprocess.DEVNULL,
text=True,
encoding="utf-8",
).strip()
porcelain = subprocess.check_output(
["git", "status", "--porcelain", "--", ".", ":(exclude)pixi.lock"],
cwd=root,
stderr=subprocess.DEVNULL,
text=True,
encoding="utf-8",
errors="replace",
)
dirty = bool(porcelain.strip())
return {"commit": commit, "dirty": dirty, "porcelain": porcelain.strip() if dirty else None}
Expand All @@ -72,7 +73,8 @@ def _get_git_diff() -> str | None:
["git", "diff", "HEAD", "--", ".", ":(exclude)pixi.lock"],
cwd=root,
stderr=subprocess.DEVNULL,
text=True,
encoding="utf-8",
errors="replace",
)
return diff if diff else None
except (FileNotFoundError, subprocess.CalledProcessError):
Expand Down