Add experiment logs to the monitoring page #48

Merged
0950726 merged 122 commits from feat/experiment-logs into dev 2026-01-28 10:16:00 +00:00
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 7d00f35990 - Show all commits

View File

@@ -9,7 +9,7 @@ const sendUserInterrupt = async (type: string, context: string) => {
const response = await fetch("http://localhost:8000/button_pressed", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ type, context }),
body: JSON.stringify({type, context}),
});
if (!response.ok) throw new Error("Backend response error");
console.log(`Interrupt Sent - Type: ${type}, Context: ${context}`);
@@ -134,13 +134,20 @@ export const StatusList: React.FC<StatusListProps> = ({
if (item.id === undefined) return null;
const isActive = !!activeIds[item.id];
const showIndicator = type !== 'norm';
const canOverride = showIndicator && !isActive;
const canOverride = showIndicator && !isActive || (type === 'cond_norm' && isActive);
const isCurrentGoal = type === 'goal' && idx === currentGoalIndex;
const handleOverrideClick = () => {
if (!canOverride) return;
sendUserInterrupt("override", String(item.id));
if (type === 'cond_norm' && isActive){
{/* Unachieve conditional norm */}
sendUserInterrupt("override_unachieve", String(item.id));
}
else {
sendUserInterrupt("override", String(item.id));
}
};
return (

View File

@@ -139,7 +139,7 @@ const MonitoringPage: React.FC = () => {
let prefix = "";
if (t.condition && typeof t.condition !== "string" && "keyword" in t.condition && typeof t.condition.keyword === "string") {
prefix = `if keywords said: "${t.condition.keyword}"`;
prefix = `if keyword said: "${t.condition.keyword}"`;
} else if (t.condition && typeof t.condition !== "string" && "name" in t.condition && typeof t.condition.name === "string") {
prefix = `if LLM belief: ${t.condition.name}`;
} else { //fallback
@@ -183,7 +183,7 @@ const MonitoringPage: React.FC = () => {
label: (() => {
let prefix = "";
if (n.condition && typeof n.condition !== "string" && "keyword" in n.condition && typeof n.condition.keyword === "string") {
prefix = `if keywords said: "${n.condition.keyword}"`;
prefix = `if keyword said: "${n.condition.keyword}"`;
} else if (n.condition && typeof n.condition !== "string" && "name" in n.condition && typeof n.condition.name === "string") {
prefix = `if LLM belief: ${n.condition.name}`;
}