Captures the porting decisions made in this round (pi-rules fingerprinting + omo transcript-aware dedup) along with the pre/post functional and performance gap matrices for codex-rules, pi-rules, and the omo rules-injector.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ports the codex-rules transcript-aware dedup strategy: when a session cache is fresh (process restart or compaction-cleared cache), the injector now scans prior tool outputs for the `[Rule: <relativePath>]` banner and pre-populates the cache so duplicate rule injections are suppressed even when the persistent JSON has been lost. Hydration runs at most once per session per process, fails open on transport errors, and is short-circuited when the same banner reappears.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The previous commits in this branch inadvertently dropped the prominent
ROADMAP-refactor-in-progress warning from AGENTS.md. That change is
unrelated to fixing the team_send_message ambiguous delivery loss and
should not ride along with this PR.
This commit restores the banner verbatim from the dev branch tip.
Reduce the ralph loop continuation prompt from ~15 lines to ~3 lines:
- Keep system directive prefix for proper identification
- Keep the essential 'output <promise>DONE</promise>' instruction
- Keep the original task prompt (needed context)
- Remove verbose boilerplate about reviewing progress and not stopping
When both default_mode.ultrawork and default_mode.ralph_loop are true,
the ralph loop handles ultrawork behavior via its continuation mechanism
(prepends 'ultrawork' to each iteration prompt). Injecting the ultrawork
system prompt on top would be redundant — the continuation prompt
re-triggers keyword detection, which defeats the purpose of invisible
system prompt injection.
The ultrawork flag still controls loop behavior (500 max iterations +
Oracle verification gate) via chat-message.ts startLoop({ ultrawork }).
When default_mode.ultrawork is enabled, inject the ultrawork behavioral
instructions into the system prompt (experimental.chat.system.transform)
instead of prepending them to the user's visible chat message.
- system-transform.ts: No-op handler now injects ultrawork message into
output.system[] when defaultMode.ultrawork is active. Checks for existing
<ultrawork-mode> tag to avoid re-injection after compaction.
- keyword-detector/hook.ts: Removes the visible text injection
(output.parts[].text prepend) for default_mode.ultrawork path. Only
shows the toast as the user-facing indicator.
- plugin-interface.ts: Wires getUltraworkMessage from keyword-detector
into createSystemTransformHandler.
Result: Ultrawork mode activates silently via system prompt — the chat
stays clean, and only a toast shows 'Ultrawork Mode Active'.
Add new `default_mode` config section with two boolean fields:
- `ultrawork`: Auto-inject ultrawork mode prompt on main session start
without requiring the "ultrawork"/"ulw" keyword. Wired through the
keyword-detector hook — injects once per session, respects existing
guards (non-OMO agents, planner agents, subagent sessions).
- `ralph_loop`: Auto-start ralph loop on first main session message
without requiring /ralph-loop or /ulw-loop commands. When ultrawork
is also enabled, the loop starts in ultrawork mode.
Usage:
```jsonc
{
"default_mode": {
"ultrawork": true, // Always get ultrawork prompt on start
"ralph_loop": true // Auto-start ralph loop
}
}
```
Files: 7 modified/added, ~65 LOC added.
Also fix CI test isolation: run each test file in its own bun process to prevent
mock.module() leaks across files that were introduced by upstream commit 6acca09b.