Do you need to file an issue?
Describe the bug
GitHub knowledge sources do not refresh their persisted sync state when the remote branch still points to the previously synced commit.
In deeptutor/services/github_source/sync.py, sync_source() returns immediately when old_sha == latest_sha:
if old_sha and old_sha == latest_sha:
return SyncResult(ok=True, skipped=True)
This successful remote check does not update last_synced_at, set last_sync_status back to success, or clear a previous last_sync_error.
The background service uses last_synced_at to determine whether a source is stale and checks sources every hour. Once an unchanged source becomes older than the 24-hour freshness window, every subsequent hourly cycle checks GitHub again but leaves the source stale.
A previous transient sync error also remains visible even after a later GitHub check succeeds and confirms that the source is current.
The web-source sync path already persists a fresh success state after an unchanged crawl, so the two source types currently behave differently.
Steps to reproduce
- Add a GitHub source to a knowledge base and complete an initial sync.
- Leave the remote branch unchanged so that its current SHA still matches
last_synced_sha.
- Make the persisted
last_synced_at older than 24 hours. Optionally leave last_sync_status="error" and an old last_sync_error from a transient failure.
- Run a GitHub source synchronization cycle.
- Observe that the result is successful with
skipped=True.
- Inspect the source metadata:
last_synced_at, last_sync_status, and last_sync_error are unchanged.
- Run the background cycle again. The source is still considered stale and GitHub is queried again.
Expected Behavior
A successful same-SHA check should persist a fresh synchronization state:
- refresh
last_synced_at;
- set
last_sync_status to success;
- clear
last_sync_error;
- retain the current
last_synced_sha;
- return
skipped=True without downloading or re-indexing files.
The source should then remain fresh until the next 24-hour synchronization window.
Related Module
Knowledge Base Management
Configuration Used
A knowledge base with a GitHub source whose last_synced_sha matches the current remote branch SHA and whose last_synced_at is older than the 24-hour synchronization interval.
Logs and screenshots
No runtime log is required to reproduce this issue. The behavior follows directly from the same-SHA early return in deeptutor/services/github_source/sync.py.
Additional Information
- DeepTutor Version: latest
main at commit 897fce5
- Operating System: platform-independent
- Python Version: not environment-specific
- Node.js Version: not applicable
- Browser: not applicable
- Related Issues: none found
Relevant code:
deeptutor/services/github_source/sync.py: same-SHA early return
deeptutor/services/github_source/sync_service.py: hourly checks and stale filtering
deeptutor/services/base_sync.py: last_synced_at-based staleness
deeptutor/services/web_source/sync.py: persists success state after unchanged crawls
Do you need to file an issue?
Describe the bug
GitHub knowledge sources do not refresh their persisted sync state when the remote branch still points to the previously synced commit.
In
deeptutor/services/github_source/sync.py,sync_source()returns immediately whenold_sha == latest_sha:This successful remote check does not update last_synced_at, set last_sync_status back to success, or clear a previous last_sync_error.
The background service uses last_synced_at to determine whether a source is stale and checks sources every hour. Once an unchanged source becomes older than the 24-hour freshness window, every subsequent hourly cycle checks GitHub again but leaves the source stale.
A previous transient sync error also remains visible even after a later GitHub check succeeds and confirms that the source is current.
The web-source sync path already persists a fresh success state after an unchanged crawl, so the two source types currently behave differently.
Steps to reproduce
last_synced_sha.last_synced_atolder than 24 hours. Optionally leavelast_sync_status="error"and an oldlast_sync_errorfrom a transient failure.skipped=True.last_synced_at,last_sync_status, andlast_sync_errorare unchanged.Expected Behavior
A successful same-SHA check should persist a fresh synchronization state:
last_synced_at;last_sync_statustosuccess;last_sync_error;last_synced_sha;skipped=Truewithout downloading or re-indexing files.The source should then remain fresh until the next 24-hour synchronization window.
Related Module
Knowledge Base Management
Configuration Used
A knowledge base with a GitHub source whose
last_synced_shamatches the current remote branch SHA and whoselast_synced_atis older than the 24-hour synchronization interval.Logs and screenshots
No runtime log is required to reproduce this issue. The behavior follows directly from the same-SHA early return in
deeptutor/services/github_source/sync.py.Additional Information
mainat commit897fce5Relevant code:
deeptutor/services/github_source/sync.py: same-SHA early returndeeptutor/services/github_source/sync_service.py: hourly checks and stale filteringdeeptutor/services/base_sync.py:last_synced_at-based stalenessdeeptutor/services/web_source/sync.py: persists success state after unchanged crawls