Skip to content
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
474c4a3
feat(coding-agent): add auto refine review hook
sethkarten Jun 18, 2026
ba7195e
fix(coding-agent): keep auto refine model stable
sethkarten Jun 18, 2026
637760b
Merge remote-tracking branch 'origin/main' into feature/auto-refine-hook
sethkarten Jun 18, 2026
c35e12f
fix(coding-agent): defer auto refine during compaction continuations
sethkarten Jun 18, 2026
30cc197
Merge remote-tracking branch 'origin/main' into feature/auto-refine-hook
sethkarten Jun 18, 2026
2b7b09f
fix(coding-agent): keep auto refine reviews pending safely
sethkarten Jun 18, 2026
68a4507
Add user orchestrator agent messaging and observe
sethkarten Jun 18, 2026
08aa1f1
Add orchestration heartbeat skill
sethkarten Jun 18, 2026
4e9810d
fix(coding-agent): guard pending auto refine application
sethkarten Jun 18, 2026
d455495
fix(coding-agent): clear auto refine state on branch navigation
sethkarten Jun 18, 2026
44d137a
Address user orchestrator PR review comments
sethkarten Jun 18, 2026
da7d873
Tighten agent message rate limiting
sethkarten Jun 18, 2026
9cff30b
Harden agent message queue safety
sethkarten Jun 18, 2026
bb78549
Preserve agent message reservations on queue clear
sethkarten Jun 18, 2026
1706020
Serialize agent messages per target
sethkarten Jun 18, 2026
16b1c76
Handle queued agent message edge cases
sethkarten Jun 18, 2026
f4d471c
Preserve orchestration heartbeat schedule on refresh
sethkarten Jun 18, 2026
8cfd366
docs(coding-agent): guide refine scope decisions
sethkarten Jun 18, 2026
608ea7c
feat(coding-agent): split harness state into local and global scopes
sethkarten Jun 18, 2026
642d2df
Merge remote-tracking branch 'origin/main' into feature/auto-refine-hook
sethkarten Jun 19, 2026
6d8b2cf
fix(coding-agent): target refine rollback scope from history
sethkarten Jun 19, 2026
14ed7c5
fix(coding-agent): record auto refine cooldown after branch changes
sethkarten Jun 19, 2026
58c41a7
fix(coding-agent): harden auto refine scope handling
sethkarten Jun 19, 2026
efb08e2
feat: add autonomous continuation mode
sethkarten Jun 23, 2026
6c4853a
feat: require autonomous terminal evidence
sethkarten Jun 23, 2026
34dbb16
Merge remote-tracking branch 'origin/main' into feature/auto-refine-hook
sethkarten Jun 25, 2026
4d6a7e0
Clarify refine as continual harness state
sethkarten Jun 25, 2026
42d31bf
Strengthen continual harness refine language
sethkarten Jun 25, 2026
7de62b7
Balance continual harness and RLM wording
sethkarten Jun 25, 2026
bf60547
Fix auto-refine review comments
sethkarten Jun 25, 2026
c15261b
Fix refine scope status label
sethkarten Jun 25, 2026
b244967
Address follow-up auto-refine comments
sethkarten Jun 25, 2026
6e00bf9
Preserve refine scope defaults across clients
sethkarten Jun 25, 2026
dadb0ac
Preserve refine scope defaults in servers
sethkarten Jun 25, 2026
8224ca8
Normalize refine display ids by scope
sethkarten Jun 25, 2026
14170a2
Use original local harness for refine rollback
sethkarten Jun 25, 2026
aa15e21
Harden auto-refine state routing
sethkarten Jun 25, 2026
0f41213
Preserve explicit harness dir on cache hits
sethkarten Jun 25, 2026
13da4e7
Defer heartbeat cron jobs while sessions are active
sethkarten Jun 25, 2026
fa525b5
feat(coding-agent): default thinking to xhigh
sethkarten Jun 26, 2026
c26052b
fix: keep print autonomous gates running
sethkarten Jun 29, 2026
37a9cfa
fix: avoid autonomous gate rerun without workspace changes
sethkarten Jun 29, 2026
406a985
fix: ignore generated lockfile for autonomous gate rerun guard
sethkarten Jun 29, 2026
5d2785e
Merge remote-tracking branch 'origin/pr-222' into feature/autonomous-…
sethkarten Jun 29, 2026
46c33b5
Merge remote-tracking branch 'origin/pr-207' into feature/autonomous-…
sethkarten Jun 29, 2026
5fcf335
Merge remote-tracking branch 'origin/pr-201' into feature/autonomous-…
sethkarten Jun 29, 2026
0d2a730
Merge remote-tracking branch 'origin/pr-266' into feature/autonomous-…
sethkarten Jun 29, 2026
43d96b7
Merge remote-tracking branch 'origin/pr-265' into feature/autonomous-…
sethkarten Jun 29, 2026
7347ae5
fix: keep autonomous evals under verifier control
sethkarten Jun 29, 2026
27392a8
fix: let verifier gates complete autonomous evals
sethkarten Jun 29, 2026
a7b6baa
Merge remote-tracking branch 'origin/main' into feature/autonomous-eval
sethkarten Jun 29, 2026
25364ce
test: update rlm prompt expectation
sethkarten Jun 29, 2026
cf34d83
fix: keep print-mode autonomous gates progressing
sethkarten Jun 30, 2026
a4d13c6
fix: advance unchanged autonomous gate retries
sethkarten Jun 30, 2026
cff2394
fix: keep print-mode gates alive on repeated status
sethkarten Jun 30, 2026
b71b025
fix: report print-mode autonomous limit reasons
sethkarten Jul 1, 2026
bf577ff
merge main into autonomous eval
sethkarten Jul 1, 2026
18b76b8
Merge remote-tracking branch 'origin/main' into feature/autonomous-eval
sethkarten Jul 1, 2026
fbdf153
Merge remote-tracking branch 'origin/main' into feature/autonomous-eval
sethkarten Jul 2, 2026
e36f23a
fix: ignore failed turns in autonomous usage
sethkarten Jul 2, 2026
efe41af
fix: clear queued autonomous continuations
sethkarten Jul 2, 2026
343a4d8
fix: preserve autonomous continuations on retry
sethkarten Jul 2, 2026
c657e92
fix: verify gates before autonomous limits
sethkarten Jul 2, 2026
0ca6d8e
fix: keep queued continuations cancellable
sethkarten Jul 2, 2026
9b7d5e3
fix: stop print gate loop on assistant errors
sethkarten Jul 2, 2026
cf52286
fix: clear autonomous queue on skipped compaction
sethkarten Jul 2, 2026
65f3079
fix: restore autonomous state on skipped compaction
sethkarten Jul 2, 2026
d374ebe
fix: preserve queued autonomous continuations
sethkarten Jul 2, 2026
612739e
fix: keep autonomous print gates alive after transient errors
sethkarten Jul 2, 2026
b440ba8
fix: count print-mode autonomous gate continuations
sethkarten Jul 2, 2026
8ffa4f2
fix: wait for queued autonomous gate retries
sethkarten Jul 2, 2026
6a7c655
fix: bypass input handlers for autonomous gate retries
sethkarten Jul 2, 2026
a849bd2
Merge remote-tracking branch 'origin/main' into feature/autonomous-eval
sethkarten Jul 8, 2026
f3ec6c9
fix(coding-agent): bypass input handlers for internal prompts
sethkarten Jul 8, 2026
3f4f5a2
fix(coding-agent): address autonomous review findings
sethkarten Jul 8, 2026
44738aa
Merge remote-tracking branch 'origin/main' into HEAD
sethkarten Jul 9, 2026
fc2798f
fix(coding-agent): respect autonomous prompt backpressure
sethkarten Jul 9, 2026
3468209
fix(coding-agent): suppress host gate auto continuations
sethkarten Jul 9, 2026
6a39d68
fix(coding-agent): preserve queued host gate suppression
sethkarten Jul 9, 2026
1c4954b
fix(coding-agent): refresh print-mode autonomous gates
sethkarten Jul 10, 2026
5d2f245
Merge remote-tracking branch 'origin/main' into HEAD
sethkarten Jul 10, 2026
d5fb92a
Merge remote-tracking branch 'origin/main' into HEAD
sethkarten Jul 10, 2026
ae9fb38
Merge remote-tracking branch 'origin/main' into HEAD
sethkarten Jul 10, 2026
3af140d
merge main into feature/autonomous-eval
kevinjosethomas Jul 13, 2026
21a0e16
Merge remote-tracking branch 'origin/main' into HEAD
sethkarten Jul 13, 2026
33b6a43
fix(coding-agent): address autonomous review blockers
sethkarten Jul 13, 2026
629f835
fix(coding-agent): harden autonomous gate verification
kevinjosethomas Jul 13, 2026
1705450
Merge remote-tracking branch 'origin/main' into pr-278-review
kevinjosethomas Jul 13, 2026
5ea8cdb
fix(coding-agent): kill autonomous gate process trees
kevinjosethomas Jul 13, 2026
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
3 changes: 3 additions & 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 autonomous mode with host-side continuations, configurable limits, and quality gates for evaluator-controlled runs ([#278](https://github.com/PrimeIntellect-ai/prime-agent/pull/278) by [@sethkarten](https://github.com/sethkarten)).
- Changed agent-to-agent messages to render as directional rows, with received messages expandable in chat and sent messages shown below their Python cell ([ENG-4531](https://linear.app/primeintellect/issue/ENG-4531/collapse-and-simplify-agent2agent-messages-in-chat-tui)).
- Fixed IPython state restore notices rendering as full user messages when prompts were queued or restored ([ENG-4530](https://linear.app/primeintellect/issue/ENG-4530/collapse-ipython-state-restore-messages-in-chat-tui)).
- Changed bare `/mcp` to open the Services menu while preserving explicit `list`, `login`, and `logout` subcommands ([ENG-4535](https://linear.app/primeintellect/issue/ENG-4535/open-services-mcp-menu-from-mcp)).
Expand Down Expand Up @@ -29,6 +30,7 @@
- Changed `/model` to sort featured flagship models above a provider's long tail (with a numeric-aware alphabetical tiebreak), so the full Prime Inference catalog doesn't flood the picker.
- Fixed selector prompts and choices filling their background through the terminal's right edge.
- Changed automatic harness refinement to be enabled by default while keeping `autoRefine.enabled: false` as the opt-out.
- Changed the default thinking level to `xhigh` for models that support it ([#278](https://github.com/PrimeIntellect-ai/prime-agent/pull/278) by [@sethkarten](https://github.com/sethkarten)).
Comment thread
kevinjosethomas marked this conversation as resolved.
Resolved
- Fixed non-numeric `autoRefine.turnInterval` and `autoRefine.cooldownMs` settings falling back to defaults instead of silently enabling a noisy auto-refine loop.
- Fixed all session-resume entry points to share a searchable full-screen picker, stream results while loading, and support renaming ([ENG-4513](https://linear.app/primeintellect/issue/ENG-4513/resume-in-agents-view-is-broken)).

Expand All @@ -48,6 +50,7 @@
- Fixed provider errors being surfaced instead of retried within the retry budget ([ENG-4503](https://linear.app/primeintellect/issue/ENG-4503/restarting-old-session-returns-empty-model-response)).
- Fixed Agents View returning from fullscreen sessions without flashing primary scrollback ([ENG-4508](https://linear.app/primeintellect/issue/ENG-4508/fullscreen-mode-agents-view-scroll)).


## [0.2.6] - 2026-07-06

- Fixed the installer splash flickering during animation and resize by stabilizing full-screen redraws and removing misleading synthetic percentages ([ENG-4481](https://linear.app/primeintellect/issue/ENG-4481/installer-screen-is-unstable-and-flickery)).
Expand Down
4 changes: 2 additions & 2 deletions packages/coding-agent/docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Edit directly or use `/settings` for common options.
|---------|------|---------|-------------|
| `defaultProvider` | string | - | Default provider (e.g., `"anthropic"`, `"openai"`) |
| `defaultModel` | string | - | Default model ID |
| `defaultThinkingLevel` | string | - | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
| `defaultThinkingLevel` | string | `"xhigh"` | `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"` |
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
| `thinkingBudgets` | object | - | Custom token budgets per thinking level |

Expand Down Expand Up @@ -258,7 +258,7 @@ See [packages.md](packages.md) for package management details.
{
"defaultProvider": "anthropic",
"defaultModel": "claude-sonnet-4-20250514",
"defaultThinkingLevel": "medium",
"defaultThinkingLevel": "xhigh",
"theme": "dark",
"compaction": {
"enabled": true,
Expand Down
6 changes: 3 additions & 3 deletions packages/coding-agent/skills/agent-observe/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ recent = await agent_observe.recent_messages("worker", limit=6)
message preview. This includes subagents shown in the agents view; filter
by `runtimeKind == "subagent"` and `parentSessionId` or
`parentActiveSessionId` to inspect subagents that belong to your session.
- `await agent_observe.get_agent(target)` returns one agent summary. `target`
is resolved like other live-session selectors: active id, session id/name, or
unambiguous suffix.
- `await agent_observe.get_agent(target)` returns `agent`, where `agent`
contains one agent summary. `target` is resolved like other live-session
selectors: active id, session id/name, or unambiguous suffix.
- `await agent_observe.recent_messages(target, limit=8, max_chars=800)`
returns up to `limit` recent bounded message previews for the target session.
`limit` must be 1-50, and `max_chars` must be 80-2000.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@ def _first_value(agent: dict[str, Any], *keys: str) -> Any:
return None


def _safe_field(value: Any) -> str | None:
if value is None:
return None
text = str(value)
sanitized = "".join(" " if ord(char) < 32 or ord(char) == 127 else char for char in text)
sanitized = " ".join(sanitized.split())
return sanitized or None


def _session_label(agent: dict[str, Any]) -> str:
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Resolved
name = _first_value(agent, "sessionName", "name")
session_id = _first_value(agent, "sessionId", "session_id")
active_session_id = _first_value(agent, "activeSessionId", "active_session_id")
cwd = agent.get("cwd")
status = agent.get("status")
streaming = _first_value(agent, "isStreaming", "streaming")
pending = _first_value(agent, "pendingMessageCount", "pending_message_count")
name = _safe_field(_first_value(agent, "sessionName", "name"))
session_id = _safe_field(_first_value(agent, "sessionId", "session_id"))
active_session_id = _safe_field(_first_value(agent, "activeSessionId", "active_session_id"))
cwd = _safe_field(agent.get("cwd"))
status = _safe_field(agent.get("status"))
streaming = _safe_field(_first_value(agent, "isStreaming", "streaming"))
pending = _safe_field(_first_value(agent, "pendingMessageCount", "pending_message_count"))
parts = [
f"name={name}" if name else None,
f"session_id={session_id}" if session_id else None,
Expand Down
72 changes: 72 additions & 0 deletions packages/coding-agent/src/cli/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ export interface Args {
themes?: string[];
noThemes?: boolean;
noContextFiles?: boolean;
autonomous?: boolean;
autonomousGates?: string[];
autonomousGateRetries?: number;
autonomousGateTimeoutMs?: number;
autonomousMaxContinuations?: number;
autonomousMaxTurns?: number;
autonomousMaxTokens?: number;
autonomousTimeoutMs?: number;
listModels?: string | true;
offline?: boolean;
verbose?: boolean;
Expand Down Expand Up @@ -197,6 +205,44 @@ export function parseArgs(args: string[]): Args {
result.noThemes = true;
} else if (arg === "--no-context-files" || arg === "-nc") {
result.noContextFiles = true;
} else if (arg === "--autonomous") {
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Resolved
result.autonomous = true;
} else if (arg === "--autonomous-gate") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousGates = result.autonomousGates ?? [];
result.autonomousGates.push(args[++i]);
}
} else if (arg === "--autonomous-gate-retries") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousGateRetries = parsePositiveInt(args[++i], "--autonomous-gate-retries", result);
}
} else if (arg === "--autonomous-gate-timeout-ms") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousGateTimeoutMs = parsePositiveInt(args[++i], "--autonomous-gate-timeout-ms", result);
}
} else if (arg === "--autonomous-max-continuations") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousMaxContinuations = parsePositiveInt(args[++i], "--autonomous-max-continuations", result);
}
} else if (arg === "--autonomous-max-turns") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousMaxTurns = parsePositiveInt(args[++i], "--autonomous-max-turns", result);
}
} else if (arg === "--autonomous-max-tokens") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousMaxTokens = parsePositiveInt(args[++i], "--autonomous-max-tokens", result);
}
} else if (arg === "--autonomous-timeout-ms") {
result.autonomous = true;
if (hasRequiredOptionValue(args, i, arg, result)) {
result.autonomousTimeoutMs = parsePositiveInt(args[++i], "--autonomous-timeout-ms", result);
}
} else if (arg === "--list-models") {
// Check if next arg is a search pattern (not a flag or file arg)
if (i + 1 < args.length && !args[i + 1].startsWith("-") && !args[i + 1].startsWith("@")) {
Expand Down Expand Up @@ -292,6 +338,14 @@ ${chalk.bold("Options:")}
--theme <path> Load a theme file or directory (can be used multiple times)
--no-themes Disable theme discovery and loading
--no-context-files, -nc Disable AGENTS.md and CLAUDE.md discovery and loading
--autonomous Continue autonomously until host-observable terminal evidence exists
--autonomous-gate <command> Run a command before autonomous mode may finish (repeatable)
--autonomous-gate-retries <n> Max autonomous retries per failed gate (default: 3)
--autonomous-gate-timeout-ms <n> Timeout per autonomous gate command in milliseconds
--autonomous-max-continuations <n> Max autonomous follow-up messages (default: 3)
--autonomous-max-turns <n> Max assistant turns while autonomous mode is active (default: 12)
--autonomous-max-tokens <n> Max tokens while autonomous mode is active (default: 80000)
--autonomous-timeout-ms <n> Max autonomous wall-clock time in milliseconds (default: 1800000)
--export <file> Export session file to HTML and exit
--list-models [search] List available models (with optional fuzzy search)
--verbose Force verbose startup (overrides quietStartup setting)
Expand Down Expand Up @@ -404,3 +458,21 @@ ${chalk.bold("Built-in Tool Names:")}
ipython - Execute Python in a persistent IPython kernel
`);
}

function hasRequiredOptionValue(args: string[], index: number, flag: string, result: Args): boolean {
const next = args[index + 1];
if (next === undefined || next.startsWith("--")) {
result.diagnostics.push({ type: "error", message: `${flag} requires a value` });
return false;
}
return true;
}

function parsePositiveInt(value: string, flag: string, result: Args): number | undefined {
const parsed = Number(value);
if (!Number.isInteger(parsed) || parsed <= 0) {
result.diagnostics.push({ type: "error", message: `${flag} must be a positive integer` });
return undefined;
}
return parsed;
}
35 changes: 35 additions & 0 deletions packages/coding-agent/src/core/agent-session-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
import type { AgentAutonomousConfig } from "./autonomous.js";

export interface AgentSessionRuntimeConfig {
cwd?: string;
Expand All @@ -23,6 +24,7 @@ export interface AgentSessionRuntimeConfig {
themes?: string[];
noThemes?: boolean;
noContextFiles?: boolean;
autonomous?: AgentAutonomousConfig;
extensionFlagValues?: Record<string, boolean | string>;
}

Expand Down Expand Up @@ -56,6 +58,7 @@ export function mergeAgentSessionRuntimeConfig(
themes: cloneArray(override.themes ?? base.themes),
noThemes: override.noThemes ?? base.noThemes,
noContextFiles: override.noContextFiles ?? base.noContextFiles,
autonomous: mergeAutonomousConfig(base.autonomous, override.autonomous),
extensionFlagValues:
base.extensionFlagValues || override.extensionFlagValues
? { ...(base.extensionFlagValues ?? {}), ...(override.extensionFlagValues ?? {}) }
Expand All @@ -73,10 +76,42 @@ function cloneAgentSessionRuntimeConfig(config: AgentSessionRuntimeConfig): Agen
skills: cloneArray(config.skills),
promptTemplates: cloneArray(config.promptTemplates),
themes: cloneArray(config.themes),
autonomous: mergeAutonomousConfig(undefined, config.autonomous),
extensionFlagValues: config.extensionFlagValues ? { ...config.extensionFlagValues } : undefined,
};
}

export function mergeAutonomousConfig(
base: AgentAutonomousConfig | undefined,
override: AgentAutonomousConfig | undefined,
): AgentAutonomousConfig | undefined {
if (!base && !override) {
return undefined;
}
const gates = mergeAutonomousGateConfig(base?.gates, override?.gates);
return {
...(base ?? {}),
...(override ?? {}),
...(gates ? { gates } : {}),
};
}

function mergeAutonomousGateConfig(
base: AgentAutonomousConfig["gates"] | undefined,
override: AgentAutonomousConfig["gates"] | undefined,
): AgentAutonomousConfig["gates"] | undefined {
if (!base && !override) {
return undefined;
}
return {
...(base ?? {}),
...(override ?? {}),
...(override?.commands !== undefined || base?.commands !== undefined
? { commands: cloneArray(override?.commands ?? base?.commands) }
: {}),
};
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
}

function cloneArray<T>(value: T[] | undefined): T[] | undefined {
return value ? [...value] : undefined;
}
3 changes: 3 additions & 0 deletions packages/coding-agent/src/core/agent-session-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { AgentSessionMessageController } from "./agent-messages.js";
import type { AgentObserveController } from "./agent-observe.js";
import { installAgentTraceUpload } from "./agent-traces.js";
import { AuthStorage } from "./auth-storage.js";
import type { AgentAutonomousConfig } from "./autonomous.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";
Expand Down Expand Up @@ -73,6 +74,7 @@ export interface AgentSessionCreationOptions {
subagentRuntimeHost?: SubagentRuntimeHost;
rlmHeartbeatController?: AgentRlmHeartbeatController;
prewarmIpythonKernel?: boolean;
autonomous?: AgentAutonomousConfig;
}

/**
Expand Down Expand Up @@ -268,5 +270,6 @@ export async function createAgentSessionFromServices(
rlmHeartbeatController: options.rlmHeartbeatController,
sessionStartEvent: options.sessionStartEvent,
prewarmIpythonKernel: options.prewarmIpythonKernel,
autonomous: options.autonomous,
});
}
Loading