refactor(agent): dedupe harness and command workflows

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:09 +00:00
parent 04892ee230
commit f717a13039
204 changed files with 7366 additions and 11540 deletions

View File

@@ -10,29 +10,13 @@ import {
resolveStorePath,
type SessionEntry,
} from "../config/sessions.js";
import { listAgentsForGateway } from "../gateway/session-utils.js";
import { classifySessionKey, listAgentsForGateway } from "../gateway/session-utils.js";
import { buildChannelSummary } from "../infra/channel-summary.js";
import { resolveHeartbeatSummaryForAgent } from "../infra/heartbeat-runner.js";
import { peekSystemEvents } from "../infra/system-events.js";
import { parseAgentSessionKey } from "../routing/session-key.js";
import { resolveLinkChannelContext } from "./status.link-channel.js";
const classifyKey = (key: string, entry?: SessionEntry): SessionStatus["kind"] => {
if (key === "global") {
return "global";
}
if (key === "unknown") {
return "unknown";
}
if (entry?.chatType === "group" || entry?.chatType === "channel") {
return "group";
}
if (key.includes(":group:") || key.includes(":channel:")) {
return "group";
}
return "direct";
};
const buildFlags = (entry?: SessionEntry): string[] => {
if (!entry) {
return [];
@@ -159,7 +143,7 @@ export async function getStatusSummary(
return {
agentId,
key,
kind: classifyKey(key, entry),
kind: classifySessionKey(key, entry),
sessionId: entry?.sessionId,
updatedAt,
age,