Investigate CLI Injection at Session Start · Entire
Is the Entire CLI injecting anything in the start of this session and if not, why? investigate.
Evidence:
Current session:
019edc3a-aed0-7e9f-977d-e77ce53ecc1f, agent typePi.Entire hooks did fire (
session-start,turn-start) per.entire/logs/entire.log.Session state shows Entire made the once-per-session decision:
1
"context_injection_decided": true
- 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:
Entire does not inject on
SessionStartfor Pi.Pi injection is wired to
TurnStart/before_agent_start, not session creation.The trail-context gate is false for this clone.
emitContextInjection()only emits the payload iftrailsEnabledForRepo(ctx)is true. That reads.git/entire/preferences.json, and this file has notrails_enabledvalue, so the function returns false. The code intentionally markscontext_injection_decidedbefore that check, so it fails closed and won’t retry/spam later.Also, the installed Pi extension is stale.
.pi/extensions/entire/index.tscurrently ignores hook stdout. The source template now parses{"inject_context": ...}and returns a hiddenentire-contextmessage, but the installed extension does not. So even if Entire emitted injection stdout, this installed extension would not apply it until refreshed.
Summary:
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.
Additional Actions
- Checked out latest
main:92154228dc32 - Fast-forwarded from
origin/main - Rebuilt/installed
entireinto~/.local/bin - Refreshed the Pi extension so it now parses
inject_context - Cached
trails_enabled: true - Reset this session’s failed
context_injection_decidedflag
Note: working tree now has one generated config change:
M .pi/extensions/entire/index.ts
You may need to start a new Pi session for the updated extension file to be loaded.
Refresh Requirements
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.tshad 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
entirebinary; updating the binary is enough because injection is emitted byentire hooks .... - Agents without
ContextInjectorsupport: 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.
Pull Requests Created
- CLI: https://github.com/entireio/cli/pull/1469
- entire.io: https://github.com/entirehq/entire.io/pull/2449
Note: I used a separate
../entire.io-pi-updateworktree so the existing dirty../entire.iocheckout was left untouched.
Commit Details
[9ea2071Update Pi extension for context injection
Entire-Checkpoint: ee09419b55ce+40/-5](/content/gh/entireio/cli/commit/9ea20713ad3c762e1ac2954fc2601c34682b34ce/index.html)