Skip to content

Warn about missing pre-commit hooks during session workflows#167

Merged
minev-dev merged 1 commit into
mainfrom
wt/74f2ceec
Jul 15, 2026
Merged

Warn about missing pre-commit hooks during session workflows#167
minev-dev merged 1 commit into
mainfrom
wt/74f2ceec

Conversation

@minev-dev

@minev-dev minev-dev commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
  • Check configured hooks before session creation and after successful auto-commit.
  • Show actionable prek install and pre-commit install commands while allowing sessions to continue.
  • Record deduplicated commit warnings and add unit, E2E, and documentation coverage.

Co-Authored-By: Agentty

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes the pre-commit hook enforcement model from a hard commit gate to a soft advisory: a missing hook no longer aborts auto-commit, but instead triggers a [Commit Warning] in the session transcript and an overlay when the user opens the session-creation flow with a.

  • Behavioral shift in sync.rs: ensure_pre_commit_hook_ready is removed from commit_all_with_retry, so commits now succeed regardless of hook installation; the new check_pre_commit_hook_ready helper is exposed for advisory-only calls.
  • Session-creation warning (list.rs, key_handler.rs, overlay.rs, app_mode.rs): Pressing a now runs an async hook check via open_session_creation_flow; a missing hook transitions to PreCommitHookWarning mode with Enter/Esc/q navigation before reaching the selector.
  • Post-commit advisory (task.rs): After each successful auto-commit, append_pre_commit_hook_warning checks hook readiness and persists one [Commit Warning] per distinct missing-hook message, using a linear transcript scan for deduplication.

Confidence Score: 5/5

Safe to merge. The change is advisory-only and removes no commit-blocking behavior that existing callers depended on in a correctness-critical way.

All new code paths are exercised by unit tests (including the deduplication invariant checked at both in-memory and database levels) and a reworked E2E test. No error path is silently swallowed — unexpected check_pre_commit_hook_ready errors fall through to warn! logging.

No files require special attention.

Reviews (5): Last reviewed commit: "Warn about missing pre-commit hooks duri..." | Re-trigger Greptile

Comment thread crates/agentty/src/app/session/workflow/task.rs
@minev-dev minev-dev force-pushed the wt/74f2ceec branch 3 times, most recently from 4c36865 to dbffc4b Compare July 15, 2026 00:48
- Check configured hooks before session creation and after successful auto-commit.
- Show actionable `prek install` and `pre-commit install` commands while allowing sessions to continue.
- Record deduplicated commit warnings and add unit, E2E, and documentation coverage.

Co-Authored-By: [Agentty](https://github.com/agentty-xyz/agentty)
@sonarqubecloud

Copy link
Copy Markdown

@minev-dev minev-dev marked this pull request as ready for review July 15, 2026 01:05
@minev-dev minev-dev requested a review from andagaev as a code owner July 15, 2026 01:05
@minev-dev minev-dev merged commit f6f0d96 into main Jul 15, 2026
20 checks passed
@minev-dev minev-dev deleted the wt/74f2ceec branch July 15, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant