Skip to content

feat(honcho): configure the first-turn memory prompt - #2

Draft
eisene wants to merge 2 commits into
eugene/fix-honcho_loggingfrom
eugene/first_turn_prompt_configuration
Draft

eisene wants to merge 2 commits into
eugene/fix-honcho_loggingfrom
eugene/first_turn_prompt_configuration

Conversation

@eisene

@eisene eisene commented Aug 24, 2026

Copy link
Copy Markdown

What does this PR do?

Shapes the first-turn memory prompt so injected Honcho memory is read as standing requirements from the current user rather than as background about a third party.

Stacked on eugene/fix-honcho_logging (config-key repairs); this PR uses the session-start rendering added there. Three changes:

  1. Identity binding. The injected block opens with a ## Who this memory is about header naming the peer when it can be resolved, so a third-person representation ("mei wants …") is not misread as notes about somebody else.
  2. Applying-memory directive. The block closes with ## Applying this memory, stating that the preferences above are current requirements, not scoped to the project they were stated in, to be reproduced literally where they name a marker or format, and that they outrank the agent's own style defaults. Appended only when the payload actually carries preferences (a card-only or summary-only injection states none), and after budget truncation so it can't be the part that gets cut.
  3. injection.explicitObservations (strip default | keep). strip drops the raw timestamped explicit-observations wall from the peer representation and injects only the distilled deductions/patterns; keep injects the representation as rendered. The choice is load-bearing: a requirement the user stated outright lives in the explicit layer, and the deriver does not always roll it up into a deduction.

Related Issue

No open issue.

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

  • _MEMORY_SUBJECT_HEADER[_NAMED] and _subject_header(): identity-binding preamble prepended to the session-start context; falls back to an unnamed binding rather than naming the wrong peer.
  • _MEMORY_DIRECTIVE appended in prefetch when the injection carries a user representation or dialectic result.
  • injection.explicitObservations resolver, _strip_explicit_observations(), and the strip branch in _format_first_turn_context. Unknown values fall back to the default with a warning rather than raising; non-string values pass through untouched.

plugins/memory/honcho/session.py

  • subject_peer_id(): resolves the peer a session's memory is about without forcing session creation.

tests/honcho_plugin/test_session.py

  • TestExplicitObservationsMode covering the default, both modes, unknown-value fallback, case/whitespace normalisation, and the empty-after-strip edge case.

How to Test

  1. pytest tests/honcho_plugin/ -q — all tests pass, including TestExplicitObservationsMode.
  2. With HONCHO_LOGGING=1 (from the base PR), inspect a turn-1 record in ~/.honcho/injection.log: the payload opens with ## Who this memory is about and, when a user representation is present, closes with ## Applying this memory.
  3. Set injection.explicitObservations: keep and confirm the ## Explicit Observations section reappears in the payload; with strip (default) it is absent while ## Deductive Observations remains.

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)
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A (new key is Honcho plugin config in ~/.honcho/config.json)
  • 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
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A (no tool behavior changed)

Screenshots / Logs

Shape of a turn-1 injection with a user representation present:

## Who this memory is about
You are working with `mei` in this session. Everything below was learned about `mei` in earlier sessions with them. ...

## User Representation
## Deductive Observations
[2026-08-11] mei values uniform test structure.

## Applying this memory
The preferences and instructions above are standing requirements from the user you are working with now. ...

Frames injected memory with an identity-binding header (naming the peer
when resolvable) and closes it with an applying-memory directive, so a
third-person representation is not read as notes about someone else and
stated preferences are not dropped as out of scope. Adds the
injection.explicitObservations mode (strip | keep) controlling whether
the raw timestamped explicit-observations wall reaches the agent.

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: e7edcf9c-c95c-40fb-b470-77744ccd8c14

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

ran on a7b0363 — Merge remote-tracking branch 'origin/eugene/fix-honcho_loggi

❌ Job failures

Check contributors / check-attribution · View job

Job Check contributors / check-attribution failed.


debug info

CI timings

CI timings · View report · View job

Wall time 1445m1s vs 1440m46s (+0.3%). 8 job(s) slower, 3 faster, 1 unchanged.

  • OSV scan / Emit review status: -24.0s
  • Check contributors / check-attribution: -23.0s
  • Check no committed infographics / check-no-committed-infographics: -19.0s
  • Python lints / Windows footguns (blocking): +18.0s
  • Python tests / e2e: +12.0s

ajspig pushed a commit that referenced this pull request Sep 18, 2026
`_TERMINAL_KANBAN_TOOLS` listed only `kanban_complete` / `kanban_block`,
so the turn-end guard fired at workers that had already handed the card
off correctly:

- A build worker that calls `kanban_request_review` moves the card from
  `running` to `review` (tools/kanban_tools.py `_handle_request_review`),
  yet `session_called_kanban_terminal()` returned False and the nudge
  told it "Task is still `running`" — false by then — and to call
  `kanban_complete`, which would close a card that must go through
  review. Both goal-mode prompts name that tool explicitly
  (hermes_cli/goals.py `KANBAN_GOAL_CONTINUATION_TEMPLATE` and
  `KANBAN_GOAL_FINALIZE_TEMPLATE`), so the prompt and the guard
  contradicted each other.

- Review agents hit the same wall. The review lane spawns through the
  same `_default_spawn`, which sets `HERMES_KANBAN_TASK`, so the guard is
  active for them, and the force-loaded sdlc-review skill's decision
  table ends the request-changes path on `kanban_request_changes`.

Adds both handoff tools to the set. Workers that obey their prompt now
exit cleanly; the guard still fires for a non-terminal board tool, which
is the case it exists for.

Covers lifecycle mismatch #2 of NousResearch#94916 only — the `dispatch --dry-run`
half is a separate change and is discussed on the issue.
ajspig pushed a commit that referenced this pull request Sep 18, 2026
… in the flag table

- Dialog 2 now shows the read-then-answer step for one benign prompt and
  warns against blind timed Enter, and names --permission-mode acceptEdits
  as the narrower opt-in (idea from PR NousResearch#113456).
- Quick Reference row and pitfall #2 carry the opt-in wording instead of
  teaching Down+Enter as the expected move.
- Regenerated the claude-code docs page.
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