실행 예시실제 실행 · claude-opus-5-5 · 2026년 10월
Write a commit message for this staged diff:
```diff
--- a/src/auth/session.py
+++ b/src/auth/session.py
@@ -8,9 +8,15 @@ SESSION_TTL = timedelta(hours=12)
def is_session_valid(session) -> bool:
- return session.created_at + SESSION_TTL > datetime.now()
+ # created_at is stored in UTC; naive local now() made sessions expire
+ # early or late depending on the server's timezone.
+ return session.created_at + SESSION_TTL > datetime.now(timezone.utc)
--- a/tests/test_session.py
+++ b/tests/test_session.py
@@ -20,3 +20,12 @@ def test_session_expires_after_ttl():
assert not is_session_valid(old)
+
+
+def test_session_valid_on_non_utc_server(monkeypatch):
+ monkeypatch.setenv("TZ", "Asia/Shanghai")
+ time.tzset()
+ fresh = make_session(created_at=datetime.now(timezone.utc))
+ assert is_session_valid(fresh)
```
Users on our Singapore and Shanghai servers were being logged out about 8 hours early. This fixes issue #214.
Skill: caveman-commit
fix(auth): compare session expiry against UTC now
created_at is stored in UTC, but expiry was checked against naive
local datetime.now(). On UTC+8 servers (Singapore, Shanghai) users
were logged out ~8 hours early.
Closes #214
The diff doesn't show any import changes, so check two things before you commit:
session.pyneedstimezoneimported fromdatetime.- The test file needs
timeandtimezoneimported.
created_at also has to be timezone-aware. If it's ever stored as a naive datetime, comparing it with datetime.now(timezone.utc) will raise a TypeError.
Real run recorded with claude-code / claude-opus-5-5. Output is shown verbatim, unmodified.
하는 일
변경 사항에 맞는 커밋 메시지를 Conventional Commits 형식으로 씁니다. 형식은 <type>(<scope>): <명령형 요약>이며, 가능하면 50자 이하, 최대 72자입니다.
작동 방식
- "write a commit", "commit message", /commit, /caveman-commit으로 실행됩니다.
- 이유가 분명하지 않을 때만 본문을 씁니다. 호환성을 깨는 변경, 보안 수정, 데이터 마이그레이션, 되돌리기 커밋에는 항상 본문을 붙입니다.
- "이 커밋은 ~합니다" 같은 문장, 이모지, AI 서명 줄은 넣지 않습니다(사용자 규칙에서 서명 trailer를 요구하는 경우는 예외).
이럴 때 좋습니다
git 기록을 짧고 일관되게, 나중에 디버깅하는 사람에게 도움이 되게 유지하고 싶을 때.
알아 둘 점
메시지를 코드 블록으로 출력하고 끝납니다. 파일 스테이징, 커밋, amend는 하지 않습니다.
참고 사항 및 위험
지시문만 담긴 파일입니다. 스크립트가 없고, 네트워크에 연결하지 않으며, 파일을 쓰지 않습니다. 패키지에는 원본 저장소의 README, LICENSE, NOTICE도 들어 있습니다. git 명령어는 실행하지 않습니다.
SKILL.md 원본패키지에 파일 4개