Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/coding-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Added built-in Herdr integration that reports agent lifecycle state to Herdr panes automatically, without requiring `herdr integration install pi`.
- Changed Escape to interrupt active work with a visible abort notice, double Escape to open the session tree from an empty prompt or clear an idle draft, and `?` to show shortcuts ([ENG-4489](https://linear.app/primeintellect/issue/ENG-4489/rewire-prime-agent-shortcuts-to-match-claude-code-flow)).
- Changed new-chat guidance to show concise shell, command, file, and shortcut hints, with Agents View first and `? for shortcuts` after the model and effort ([ENG-4489](https://linear.app/primeintellect/issue/ENG-4489/rewire-prime-agent-shortcuts-to-match-claude-code-flow)).
- Changed `?` shortcut help to appear as a temporary compact panel below the transcript, while `/hotkeys` shows the full reference without Ctrl+Z ([ENG-4489](https://linear.app/primeintellect/issue/ENG-4489/rewire-prime-agent-shortcuts-to-match-claude-code-flow)).
Expand Down
23 changes: 22 additions & 1 deletion packages/coding-agent/src/core/agent-session-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { AgentObserveController } from "./agent-observe.js";
import { installAgentTraceUpload } from "./agent-traces.js";
import { AuthStorage } from "./auth-storage.js";
import type { AgentRlmHeartbeatController } from "./cron-jobs.js";
import { createHerdrAgentStateExtension } from "./extensions/builtin/herdr-agent-state.js";
import type { SessionStartEvent, ToolDefinition } from "./extensions/index.js";
import { McpManager } from "./mcp/mcp-manager.js";
import { ModelRegistry } from "./model-registry.js";
Expand Down Expand Up @@ -43,6 +44,13 @@ export interface CreateAgentSessionServicesOptions {
modelRegistry?: ModelRegistry;
extensionFlagValues?: Map<string, boolean | string>;
resourceLoaderOptions?: Omit<DefaultResourceLoaderOptions, "cwd" | "agentDir" | "settingsManager">;
/**
* Skip the built-in Herdr reporter for these services. Set for RLM subagent
* runtimes: they inherit the parent's HERDR_* pane identity, so their own
* reporter would race the parent's on the same pane and a subagent quit
* would release the pane while the parent is still running.
*/
noBuiltinHerdrReporter?: boolean;
}

export interface AgentSessionCreationOptions {
Expand Down Expand Up @@ -167,8 +175,21 @@ export async function createAgentSessionServices(
// refresh() resets the OAuth registry to built-ins; re-add user MCP providers too.
modelRegistry.setOnOAuthProvidersReset(() => mcpManager.registerUserProviders());

const resourceLoader = new DefaultResourceLoader({
const userExtensionFactories = options.resourceLoaderOptions?.extensionFactories ?? [];
// The built-in Herdr reporter defers to Herdr's own file-based integration
// when the loader actually loaded it; two reporters would race on the same
// pane. Deferral is late-bound to the loader's loaded paths (inline
// factories run after file extensions load), so a file that exists but is
// disabled or never discovered does not silence the built-in.
// noExtensions is a full opt-out: it disables the built-in reporter too,
// not just discovered extension files.
const skipHerdrReporter = options.noBuiltinHerdrReporter || options.resourceLoaderOptions?.noExtensions;
const builtinExtensionFactories = skipHerdrReporter
? []
: [createHerdrAgentStateExtension(() => resourceLoader.getLoadedExtensionPaths())];
const resourceLoader: DefaultResourceLoader = new DefaultResourceLoader({
...(options.resourceLoaderOptions ?? {}),
extensionFactories: [...builtinExtensionFactories, ...userExtensionFactories],
Comment thread
cursor[bot] marked this conversation as resolved.
cwd,
agentDir,
settingsManager,
Expand Down
Loading