8000 OMP: ruleset not injected after /new, /resume or /fork (session_switch not handled) · Issue #291 · ayghri/i-have-adhd · GitHub
[go: up one dir, main page]

Skip to content

OMP: ruleset not injected after /new, /resume or /fork (session_switch not handled) #291

Done

Description

@Camof1ow

Environment

  • oh-my-pi (omp) 18.20.0, Windows 11
  • i-have-adhd 0.4.1 (1ecea19), installed with omp plugin install
  • ~/.omp/agent/i-have-adhd.json: { "alwaysOn": true }

What happens
The first session after omp starts gets the i-have-adhd-rules message. A session opened with /new in the same omp process does not, so ADHD mode is silently off there.

Cause
omp emits session_start once per process. /new, /resume and /fork emit session_switch, and the extension only listens to session_start, session_tree and session_compact.

Repro (RPC mode, no model call)

printf '%s\n' '{"type":"get_messages"}' '{"type":"new_session"}' '{"type":"get_messages"}' \
  | omp --mode rpc --no-session --no-extensions -e <plugin>/extensions/i-have-adhd.ts

First get_messages: 1 message (i-have-adhd-rules). After new_session: 0 messages.

Local fix
With this one line the second get_messages returns the rules message, and a prompt in the new session confirms the model sees "ADHD MODE ACTIVE":

pi.on("session_switch", async (_event, ctx) => restoreState(ctx));

#228 covers this together with session_branch and a before_agent_start fallback, but it is still a draft. Filing this as confirmation on a real omp runtime (the PR notes it was not run against one), and in case a smaller fix is wanted first.

Activity

  1. added a commit that references this issue on Dec 1, 2026
    e389f61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0