feat(heartbeat): change default target to 'last' and remove target option from UI

This commit is contained in:
Abhimanyu Saharan
2026-02-15 01:37:12 +05:30
parent 55af799223
commit 0ac22dbd7a
6 changed files with 9 additions and 67 deletions

View File

@@ -52,11 +52,6 @@ const EMOJI_OPTIONS = [
{ value: ":brain:", label: "Brain", glyph: "🧠" },
];
const HEARTBEAT_TARGET_OPTIONS: SearchableSelectOption[] = [
{ value: "none", label: "None (no outbound message)" },
{ value: "last", label: "Last channel" },
];
const getBoardOptions = (boards: BoardRead[]): SearchableSelectOption[] =>
boards.map((board) => ({
value: board.id,
@@ -111,9 +106,6 @@ export default function EditAgentPage() {
const [heartbeatEvery, setHeartbeatEvery] = useState<string | undefined>(
undefined,
);
const [heartbeatTarget, setHeartbeatTarget] = useState<string | undefined>(
undefined,
);
const [identityProfile, setIdentityProfile] = useState<
IdentityProfile | undefined
>(undefined);
@@ -166,13 +158,11 @@ export default function EditAgentPage() {
if (heartbeat && typeof heartbeat === "object") {
const record = heartbeat as Record<string, unknown>;
const every = record.every;
const target = record.target;
return {
every: typeof every === "string" && every.trim() ? every : "10m",
target: typeof target === "string" && target.trim() ? target : "none",
};
}
return { every: "10m", target: "none" };
return { every: "10m" };
}, [loadedAgent?.heartbeat_config]);
const loadedIdentityProfile = useMemo(() => {
@@ -200,7 +190,6 @@ export default function EditAgentPage() {
const resolvedIsGatewayMain =
isGatewayMain ?? Boolean(loadedAgent?.is_gateway_main);
const resolvedHeartbeatEvery = heartbeatEvery ?? loadedHeartbeat.every;
const resolvedHeartbeatTarget = heartbeatTarget ?? loadedHeartbeat.target;
const resolvedIdentityProfile = identityProfile ?? loadedIdentityProfile;
const resolvedBoardId = useMemo(() => {
@@ -244,7 +233,7 @@ export default function EditAgentPage() {
heartbeat_config: {
...existingHeartbeat,
every: resolvedHeartbeatEvery.trim() || "10m",
target: resolvedHeartbeatTarget,
target: "last",
includeReasoning:
typeof existingHeartbeat.includeReasoning === "boolean"
? existingHeartbeat.includeReasoning
@@ -449,7 +438,7 @@ export default function EditAgentPage() {
<p className="text-xs font-semibold uppercase tracking-wider text-slate-500">
Schedule & notifications
</p>
<div className="mt-4 grid gap-6 md:grid-cols-2">
<div className="mt-4">
<div className="space-y-2">
<label className="text-sm font-medium text-slate-900">
Interval
@@ -464,24 +453,6 @@ export default function EditAgentPage() {
Set how often this agent runs HEARTBEAT.md.
</p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-slate-900">
Target
</label>
<SearchableSelect
ariaLabel="Select heartbeat target"
value={resolvedHeartbeatTarget}
onValueChange={setHeartbeatTarget}
options={HEARTBEAT_TARGET_OPTIONS}
placeholder="Select target"
searchPlaceholder="Search targets..."
emptyMessage="No matching targets."
triggerClassName="w-full h-11 rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
contentClassName="rounded-xl border border-slate-200 shadow-lg"
itemClassName="px-4 py-3 text-sm text-slate-700 data-[selected=true]:bg-slate-50 data-[selected=true]:text-slate-900"
disabled={isLoading}
/>
</div>
</div>
</div>

View File

@@ -49,11 +49,6 @@ const EMOJI_OPTIONS = [
{ value: ":brain:", label: "Brain", glyph: "🧠" },
];
const HEARTBEAT_TARGET_OPTIONS: SearchableSelectOption[] = [
{ value: "none", label: "None (no outbound message)" },
{ value: "last", label: "Last channel" },
];
const getBoardOptions = (boards: BoardRead[]): SearchableSelectOption[] =>
boards.map((board) => ({
value: board.id,
@@ -81,7 +76,6 @@ export default function NewAgentPage() {
const [name, setName] = useState("");
const [boardId, setBoardId] = useState<string>("");
const [heartbeatEvery, setHeartbeatEvery] = useState("10m");
const [heartbeatTarget, setHeartbeatTarget] = useState("none");
const [identityProfile, setIdentityProfile] = useState<IdentityProfile>({
...DEFAULT_IDENTITY_PROFILE,
});
@@ -136,7 +130,7 @@ export default function NewAgentPage() {
board_id: resolvedBoardId,
heartbeat_config: {
every: heartbeatEvery.trim() || "10m",
target: heartbeatTarget,
target: "last",
includeReasoning: false,
},
identity_profile: normalizeIdentityProfile(
@@ -277,7 +271,7 @@ export default function NewAgentPage() {
<p className="text-xs font-semibold uppercase tracking-wider text-slate-500">
Schedule & notifications
</p>
<div className="mt-4 grid gap-6 md:grid-cols-2">
<div className="mt-4">
<div className="space-y-2">
<label className="text-sm font-medium text-slate-900">
Interval
@@ -292,24 +286,6 @@ export default function NewAgentPage() {
How often this agent runs HEARTBEAT.md (10m, 30m, 2h).
</p>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-slate-900">
Target
</label>
<SearchableSelect
ariaLabel="Select heartbeat target"
value={heartbeatTarget}
onValueChange={setHeartbeatTarget}
options={HEARTBEAT_TARGET_OPTIONS}
placeholder="Select target"
searchPlaceholder="Search targets..."
emptyMessage="No matching targets."
triggerClassName="w-full h-11 rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
contentClassName="rounded-xl border border-slate-200 shadow-lg"
itemClassName="px-4 py-3 text-sm text-slate-700 data-[selected=true]:bg-slate-50 data-[selected=true]:text-slate-900"
disabled={isLoading}
/>
</div>
</div>
</div>