Package release 0.4.154 from the current workspace snapshot
Constraint: Windows and Linux artifacts are built on native GitHub runners from a temporary snapshot branch Rejected: Build Windows/Linux locally on Apple Silicon | docker/wine packaging is not stable on this host Confidence: medium Scope-risk: moderate Directive: This snapshot branch is transport-only and should be deleted after the release completes Tested: local verify/build stages before snapshot creation Not-tested: remote packaging before workflow execution
This commit is contained in:
1 parent
69a1139eb3
commit
f5ab9c7794
7 files changed
+146
-19
No files matched your search
@@ -29,7 +29,7 @@ const claudeCompatModule: ServerAdapterModule = {
|
||||
execute: claudeExecute,
|
||||
testEnvironment: claudeTestEnvironment,
|
||||
sessionCodec: claudeSessionCodec,
|
||||
nativeContextManagement: true,
|
||||
nativeContextManagement: false,
|
||||
models: claudeModels,
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ interface SessionManagementDependencies {
|
||||
// D-01/D-02: Exported for testing and external override. Conservative defaults.
|
||||
export const DEFAULT_THRESHOLDS = {
|
||||
maxRuns: 20,
|
||||
maxTokens: 500_000,
|
||||
maxTokens: 150_000,
|
||||
maxAgeHours: 72,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Run-log noise filter.
|
||||
*
|
||||
* CLI adapters emit stdout/stderr containing system-level JSON messages,
|
||||
* hook lifecycle events, skill injection notices, and assistant internals
|
||||
* (thinking/tool_use). This module strips those lines before they reach
|
||||
* the user-facing run log on disk.
|
||||
*/
|
||||
|
||||
const RE_SKILL_INJECTION = /^\[agent-company\] Injected managed skill /;
|
||||
const RE_OMC_HOOK = /^\[omc:hooks\]/;
|
||||
const RE_AGENT_COMPANY_LOG = /^\[agent-company\] (?:heartbeat|hook_|system_)/;
|
||||
|
||||
/** Matches system JSON except `init` subtype (which carries session metadata). */
|
||||
const RE_SYSTEM_JSON = /^\{"type"\s*:\s*"system"\s*,\s*"subtype"\s*:\s*"(?!init")/;
|
||||
|
||||
/** Matches assistant thinking/tool_use JSON — internal reasoning, not user-visible output. */
|
||||
const RE_ASSISTANT_INTERNAL =
|
||||
/^\{"type"\s*:\s*"assistant"\s*,\s*"subtype"\s*:\s*"(?:thinking|tool_use)"/;
|
||||
|
||||
const RE_COMPACTING = /^Compacting conversation\.\.\./;
|
||||
|
||||
function isNoisyLine(line: string): boolean {
|
||||
const trimmed = line.trimStart();
|
||||
if (trimmed.length === 0) return false;
|
||||
|
||||
return (
|
||||
RE_SKILL_INJECTION.test(trimmed) ||
|
||||
RE_OMC_HOOK.test(trimmed) ||
|
||||
RE_AGENT_COMPANY_LOG.test(trimmed) ||
|
||||
RE_SYSTEM_JSON.test(trimmed) ||
|
||||
RE_ASSISTANT_INTERNAL.test(trimmed) ||
|
||||
RE_COMPACTING.test(trimmed)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a raw log chunk by removing noisy lines.
|
||||
* @returns The cleaned chunk, or `null` if the entire chunk is noise.
|
||||
*/
|
||||
export function filterRunLogChunk(
|
||||
_stream: "stdout" | "stderr",
|
||||
chunk: string,
|
||||
): string | null {
|
||||
const lines = chunk.split("\n");
|
||||
const kept: string[] = [];
|
||||
|
||||
for (const line of lines) {
|
||||
if (!isNoisyLine(line)) {
|
||||
kept.push(line);
|
||||
}
|
||||
}
|
||||
|
||||
if (kept.length === 0) return null;
|
||||
|
||||
const result = kept.join("\n");
|
||||
return result.length === 0 ? null : result;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { getConnectorDefinition } from "../connectors";
|
||||
import type { WorkerServiceDependencies, workerMessageSchema } from "./worker-types";
|
||||
import { createCircuitBreaker } from "./circuit-breaker";
|
||||
import { handleFailureEscalation, handleSuccessReset } from "./failure-escalation";
|
||||
import { filterRunLogChunk } from "./run-log-filter";
|
||||
|
||||
const LEASE_RENEWAL_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
|
||||
|
||||
@@ -61,7 +62,10 @@ export async function handleWorkerMessage(
|
||||
}
|
||||
|
||||
if (event.type === "run-log") {
|
||||
await db.appendRunLog(event.runId, event.stream, event.chunk);
|
||||
const filtered = filterRunLogChunk(event.stream, event.chunk);
|
||||
if (filtered === null) return;
|
||||
|
||||
await db.appendRunLog(event.runId, event.stream, filtered);
|
||||
const runState = db.getRunAuthState(event.runId);
|
||||
if (runState) {
|
||||
persistRunEvent(db, logger, {
|
||||
@@ -70,10 +74,10 @@ export async function handleWorkerMessage(
|
||||
agentId: runState.agentId,
|
||||
eventType: "run_log",
|
||||
stream: event.stream,
|
||||
message: event.chunk,
|
||||
message: filtered,
|
||||
});
|
||||
}
|
||||
emitEvent(event);
|
||||
emitEvent({ ...event, chunk: filtered });
|
||||
|
||||
// Throttled lease renewal: keep execution lock alive for long-running tasks.
|
||||
// Without this, tasks exceeding the 15-minute stale lock timeout get reclaimed.
|
||||
|
||||
Reference in new issue
Block a user