Investigate CLI Injection at Session Start

Pi·GPT-5.5·dipree·3mo ago·13min·1 Checkpoint·1 file change·+40/-5·519.8K tokens

Is the Entire CLI injecting anything in the start of this session and if not, why? investigate.

3mo ago·4.8s

No — I don’t see evidence that Entire injected model-facing context at the start of this Pi session.

Evidence:

  • Current session: 019edc3a-aed0-7e9f-977d-e77ce53ecc1f, agent type Pi.

  • Entire hooks did fire (session-start, turn-start) per .entire/logs/entire.log.

  • Session state shows Entire made the once-per-session decision:

    .git/entire-sessions/019edc3a-aed0-7e9f-977d-e77ce53ecc1f.json

  • But the Pi transcript has no entire-context, inject_context, or the expected injected text:

    A trail ties together the context for a branch...

Why not:

  1. Entire does not inject on SessionStart for Pi.
    Pi injection is wired to TurnStart / before_agent_start, not session creation.

  2. The trail-context gate is false for this clone.
    emitContextInjection() only emits the payload if trailsEnabledForRepo(ctx) is true. That reads .git/entire/preferences.json, and this file has no trails_enabled value, so the function returns false. The code intentionally marks context_injection_decided before that check, so it fails closed and won’t retry/spam later.

  3. Also, the installed Pi extension is stale.
    .pi/extensions/entire/index.ts currently ignores hook stdout. The source template now parses {"inject_context": ...} and returns a hidden entire-context message, but the installed extension does not. So even if Entire emitted injection stdout, this installed extension would not apply it until refreshed.

So: Entire tracked the session, but did not inject model context into this run. Refreshing the Pi hook extension (entire configure --agent pi / re-enable) and having trails_enabled cached true would be required for that injection path to work.

Do it for me. Checkout latest main

3mo ago·5.5s

Done.

  • Checked out latest main: 92154228dc32
  • Fast-forwarded from origin/main
  • Rebuilt/installed entire into ~/.local/bin
  • Refreshed the Pi extension so it now parses inject_context
  • Cached trails_enabled: true
  • Reset this session’s failed context_injection_decided flag

Note: working tree now has one generated config change:

You may need to start a new Pi session for the updated extension file to be loaded.

Does it require to refresh every agent to get the injection?

3mo ago·16.4s

No, not every agent.

You only need to refresh agents whose repo-local generated integration code must learn how to consume the injection.

  • Pi: yes, needed refresh. Its .pi/extensions/entire/index.ts had stale code that ignored hook stdout.
  • OpenCode: likely same class — generated plugin may need refresh if installed before injection support.
  • Claude Code / Codex / Gemini: usually no refresh needed if hooks are already installed. Their hooks call the entire binary; updating the binary is enough because injection is emitted by entire hooks ....
  • Agents without ContextInjector support: won’t get this model-context injection regardless.

Also: injection is once per session and gated by trails_enabled. Future sessions should work now. Existing sessions that already recorded context_injection_decided: true won’t retry unless that flag is cleared.

The text you pasted:

A trail ties together the context for a branch...

is exactly the injection payload, so it looks like the refreshed Pi path is now working.

Create a PR with the Pi update for the CLI and entire.io repo.

3mo ago·8.3s

Created both PRs:

Note: I used a separate ../entire.io-pi-update worktree so the existing dirty ../entire.io checkout was left untouched.