entireio / entireio/cli

Agent sessions should adopt enabled repos when a long session switches git common dirs

Open
#1,439 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
5.1k
Forks
475
Avg merge
1d 11h
Merged PRs (30d)
178

Description

Summary

A long-running agent session can move from one git repository into another enabled repository and make commits that get no Entire-Checkpoint trailer, even though the CLI is installed and git hooks are present in the second repo.

This is distinct from same-repo sibling worktree matching. In this case the two repositories have different git common dirs, so the second repo's prepare-commit-msg hook cannot see the session state that was initialized in the first repo.

Observed repro from local investigation

While working on entirehq/entire.io, a Codex session was active in:

/Users/peytonmontei/Documents/entire/devenv/entire.io/.worktrees/merge-in-trails

The session state exists in the entire.io repo:

/Users/peytonmontei/Documents/entire/devenv/entire.io/.git/entire-sessions/019ed223-016e-7181-b420-dafc7d141cf4.json

Summary of that state:

agent_type: Codex
phase: active
worktree_path: /Users/peytonmontei/Documents/entire/devenv/entire.io/.worktrees/merge-in-trails
last_interaction_time: 2026-06-16T19:44:57-04:00

During the same conversation, the agent switched to the CLI repo worktree:

/private/tmp/entire-session-match-fix

and committed/pushed:

f9005540ed2b822363cf9aeefa87574a83517073 Match sessions across sibling worktrees

That commit has no trailer:

git show -s --format=%B f9005540ed2b822363cf9aeefa87574a83517073

Match sessions across sibling worktrees

The CLI repo did have hooks installed:

/Users/peytonmontei/Documents/entire/devenv/entire/.git/hooks/prepare-commit-msg

#!/bin/sh
# Entire CLI hooks
entire hooks git prepare-commit-msg "$1" "$2" 2>/dev/null || true

But its repo-local session store was empty:

/Users/peytonmontei/Documents/entire/devenv/entire/.git/entire-sessions
# no *.json session states

The git common dirs are different:

entire.io repo: /Users/peytonmontei/Documents/entire/devenv/entire.io/.git
cli repo:       /Users/peytonmontei/Documents/entire/devenv/entire/.git

So the hook in the CLI repo fired, looked in the CLI repo's .git/entire-sessions, found no active session, and skipped trailer insertion.

Expected behavior

If an agent session with Entire enabled moves into a second enabled git repository and commits there, Entire should not silently lose provenance.

Possible acceptable behaviors:

  1. Adopt/create a repo-local session state in the second repo, keyed to the same agent session/transcript, so commits in that repo get trailers/checkpoints.
  2. Detect that an agent session is active elsewhere but missing in the current repo and emit a clear warning before/when the commit hook skips.
  3. Provide an explicit multi-repo/orchestrator session model that can attach one agent transcript to multiple repo-local checkpoint streams.

Actual behavior

The commit hook silently skips because the current repo has hooks installed but no repo-local session state. The resulting commit has no Entire-Checkpoint trailer.

Why this matters

Users reasonably expect "Entire is installed and the agent session is active" to mean commits made by that agent are checkpointed. Long agent sessions often inspect or patch multiple repositories. Today, a repo switch can produce uncheckpointed commits without any visible warning.

This is especially confusing because same-repo worktree fixes do not help here: the failure crosses git common dirs, so session lookup by shared common dir is intentionally not enough.

Related

  • #529: orchestrator sessions launched outside git repos / multi-repo worktree workflows
  • #1098: global auto-enable / track sessions without per-repo configuration
  • #784 / #686: other prepare-commit-msg missing-trailer reports

Fix direction

Investigate agent lifecycle hooks for repo transitions. In particular:

  • Codex/Claude hooks should be able to initialize or adopt session state when the active agent begins operating inside a different enabled repo.
  • prepare-commit-msg should distinguish "Entire disabled" from "hooks installed but no active session in this repo during an agent-driven commit" and surface an actionable diagnostic.
  • Any cross-repo adoption must avoid accidentally attaching one repo's checkpoint metadata to another repo's commits; the checkpoint streams should remain repo-local even if they share an agent transcript/session identity.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the repo-local .git/hooks/prepare-commit-msg entry point and the entire hooks git prepare-commit-msg command, then trace how agent lifecycle hooks initialize session state and how lookup uses the git common directory. Reproduce the switch between the two enabled repositories described here. Done means cross-repository commits either receive repo-local checkpoint metadata safely or show an actionable warning instead of silently missing the trailer.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
cli, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.