Skip to content

fix(honcho): honor injection.sessionStart and the logging config key - #3

Draft
eisene wants to merge 11 commits into
mainfrom
eugene/fix-honcho_logging
Draft

eisene wants to merge 11 commits into
mainfrom
eugene/fix-honcho_logging

Conversation

@eisene

@eisene eisene commented Aug 24, 2026

Copy link
Copy Markdown

What does this PR do?

Repairs two Honcho memory plugin config keys that were parsed but never consulted at runtime.

Before this change, injection.sessionStart and the logging key / HONCHO_LOGGING env var were accepted by the config parser and then ignored — a caller pinning which context components get injected still received everything, and there was no way to see what memory was actually injected on a given turn or why an injection came back empty.

This is the base of a two-PR stack; the follow-up (eugene/first_turn_prompt_configuration) builds on the session-start rendering added here to shape the first-turn memory prompt.

Related Issue

No open issue — found while auditing the Honcho plugin's config handling.

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

plugins/memory/honcho/__init__.py

  • injection.sessionStart is now honoured: a pinned component list filters which context components (summary, peerRepresentation, peerCard, aiRepresentation, aiCard) render at session start. Unset keeps the historical render-everything behaviour; an explicitly empty list injects nothing. Render order is fixed by a component table, independent of the order the list is written in. Suppressed components are logged, not dropped silently.
  • Injection audit log: the logging config key and HONCHO_LOGGING env var (previously no-ops) now enable a JSONL audit at ~/.honcho/injection.log; HONCHO_INJECTION_LOG overrides the destination. Each record captures turn, session key, recall mode, byte count, payload, and the reason, since prefetch has several distinct ways to return an empty string (cron guard, tools-only mode, session not ready, trivial prompt, fetched-but-empty) with opposite fixes. Off by default: the record contains the representation verbatim. Log writes never raise into the agent path.

How to Test

  1. pytest tests/honcho_plugin/ -q — all tests pass.
  2. Injection audit: run with HONCHO_LOGGING=1 and inspect ~/.honcho/injection.log — every turn produces a record with a reason, empty-injection turns included.
  3. injection.sessionStart: pin e.g. ["summary", "peerCard"] and confirm via the audit log that only those components appear in the first-turn payload.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15 (arm64)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A (docstrings; behavior config lives in ~/.honcho/config.json, not hermes docs)
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A (keys are Honcho plugin config in ~/.honcho/config.json; cli-config.yaml.example honcho section is unchanged)
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (paths built with os.path.join/expanduser)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A (no tool behavior changed)

Screenshots / Logs

Sample injection audit record (~/.honcho/injection.log, one JSON object per line):

{"ts": "2026-08-24T10:12:03", "turn": 1, "session_key": "abc123", "recall_mode": "auto", "reason": "injected", "bytes": 4821, "payload": "## Session Summary\n..."}
{"ts": "2026-08-24T10:12:41", "turn": 2, "session_key": "abc123", "recall_mode": "auto", "reason": "trivial-prompt", "bytes": 0, "payload": ""}

eisene and others added 10 commits August 15, 2026 22:31
The logging is also improved a little by saving reasons
Upstream (Erosika et al.) landed saveMessages=false enforcement at the
provider layer (sync_turn, memory mirror, on_session_end, shutdown),
superseding this branch's _flush_session gate — dropped in favor of
theirs. Kept this branch's injection.sessionStart / explicitObservations
controls, subject header + directive, and injection audit log, rewired
onto upstream's reworked prefetch flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merge resolution moved the injection config resolvers out of the
try/except that used to guard them, so a config without .raw broke
init instead of failing open (tests/test_honcho_startup_fail_open.py).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keeps this PR to the config-key repairs (injection.sessionStart, the
injection audit log). The identity-binding header, applying-memory
directive, and injection.explicitObservations mode land separately in
eugene/first_turn_prompt_configuration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d0c8983-14ed-4faa-844e-ff3fc00626a0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

running on db1405a — Merge remote-tracking branch 'origin/main' into eugene/fix-h


Still running 2 jobs: OS-specific tests / Windows-only tests, Python tests / Run tests

❌ Job failures

Check contributors / check-attribution · View job

Job Check contributors / check-attribution failed.


⚠️ Action required

Unmapped contributor email(s) · View job

New contributor email(s) are not in AUTHOR_MAP.

eeisenst@gmail.com (Eugene Eisenstein)

How to fix:

Run from the PR branch:

python3 scripts/audit_pr_attribution.py --fix
git add contributors && git commit -m "chore: map contributor emails" && git push

Or map one email manually (do NOT edit AUTHOR_MAP in release.py):

python3 scripts/add_contributor.py <email> <github-username>

To find the GitHub username for an email:

gh api 'search/users?q=EMAIL+in:email' --jq '.items[0].login'

⚠️ Warnings

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

This branch has not been deployed

No deployments
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