Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  heartbeat-system-prompt.test.ts

  Sprache: JAVA
 

import { describe, expect, it } from "vitest";
import { resolveHeartbeatPromptForSystemPrompt } from "./heartbeat-system-prompt.js";

describe("resolveHeartbeatPromptForSystemPrompt", () => {
  it("omits the heartbeat section when disabled in defaults", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            defaults: {
              heartbeat: {
                includeSystemPromptSection: false,
              },
            },
          },
        },
        agentId: "main",
        defaultAgentId: "main",
      }),
    ).toBeUndefined();
  });

  it("omits the heartbeat section when the default cadence is disabled", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            defaults: {
              heartbeat: {
                every: "0m",
              },
            },
          },
        },
        agentId: "main",
        defaultAgentId: "main",
      }),
    ).toBeUndefined();
  });

  it("omits the heartbeat section when the default-agent override disables cadence", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            defaults: {
              heartbeat: {
                every: "30m",
              },
            },
            list: [
              {
                id: "main",
                heartbeat: {
                  every: "0m",
                },
              },
            ],
          },
        },
        agentId: "main",
        defaultAgentId: "main",
      }),
    ).toBeUndefined();
  });

  it("omits the heartbeat section when only a non-default agent has explicit heartbeat config", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            list: [
              { id: "main"defaulttrue },
              {
                id: "ops",
                heartbeat: {
                  every: "30m",
                },
              },
            ],
          },
        },
        agentId: "main",
        defaultAgentId: "main",
      }),
    ).toBeUndefined();
  });

  it("honors default-agent overrides for the prompt text", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            defaults: {
              heartbeat: {
                prompt: "Default prompt",
              },
            },
            list: [
              {
                id: "main",
                heartbeat: {
                  prompt: "  Ops check  ",
                },
              },
            ],
          },
        },
        agentId: "main",
        defaultAgentId: "main",
      }),
    ).toBe("Ops check");
  });

  it("does not inject the heartbeat section for non-default agents", () => {
    expect(
      resolveHeartbeatPromptForSystemPrompt({
        config: {
          agents: {
            defaults: {
              heartbeat: {
                prompt: "Default prompt",
              },
            },
            list: [
              {
                id: "ops",
                heartbeat: {
                  prompt: "Ops prompt",
                },
              },
            ],
          },
        },
        agentId: "ops",
        defaultAgentId: "main",
      }),
    ).toBeUndefined();
  });
});

Messung V0.5 in Prozent
C=95 H=94 G=94

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik