Avatar-aktivointi vain omille agents-tehtäville, ei broadcast-viesteille
Agenttiavatarit vilkkuivat itsestään koska llm_prompt-handler reagoi kaikkiin broadcastattuihin viesteihin (hubin automaattiset 10s-tehtävät, warmup jne.). Nyt avatar-logiikka laukeaa VAIN jos viestissä on task_id joka löytyy activeStreams:stä — eli kyseessä on käyttäjän oma agents-pipelinen tehtävä. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2446,7 +2446,8 @@
|
|||||||
: `→ ${msg} — generoidaan...`;
|
: `→ ${msg} — generoidaan...`;
|
||||||
}
|
}
|
||||||
} else if (data.type === "llm_prompt") {
|
} else if (data.type === "llm_prompt") {
|
||||||
if (data.task_id) {
|
// Reagoidaan VAIN agents-pipelinen tehtäviin (task_id + activeStreams)
|
||||||
|
if (data.task_id && activeStreams[data.task_id]) {
|
||||||
const term = document.getElementById('agent-terminal');
|
const term = document.getElementById('agent-terminal');
|
||||||
if (term) {
|
if (term) {
|
||||||
const model = data.model || 'llm';
|
const model = data.model || 'llm';
|
||||||
@@ -2458,26 +2459,26 @@
|
|||||||
while (term.children.length > 50 && !term.firstChild.querySelector('.stream-content')) term.removeChild(term.firstChild);
|
while (term.children.length > 50 && !term.firstChild.querySelector('.stream-content')) term.removeChild(term.firstChild);
|
||||||
term.scrollTop = term.scrollHeight;
|
term.scrollTop = term.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avatar-aktivointi vain omille tehtäville
|
||||||
|
document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active'));
|
||||||
|
const model = data.model || '';
|
||||||
|
const p = data.prompt ? data.prompt.toLowerCase() : '';
|
||||||
|
|
||||||
|
if (p.includes('tiiminvetäjä') || p.includes('pilko')) {
|
||||||
|
document.getElementById('avatar-kpn')?.classList.add('active');
|
||||||
|
} else if (p.includes('arvioi seuraava koodi') || p.includes('ohjelmiston julkaisu')) {
|
||||||
|
document.getElementById('avatar-tester')?.classList.add('active');
|
||||||
|
} else if (p.includes('tervehdi')) {
|
||||||
|
document.getElementById('avatar-client')?.classList.add('active');
|
||||||
|
} else if (p.includes('test')) {
|
||||||
|
document.getElementById('avatar-qa')?.classList.add('active');
|
||||||
|
} else if (model.includes('coder') || model.includes('Coder')) {
|
||||||
|
document.getElementById('avatar-coder')?.classList.add('active');
|
||||||
|
} else if (model.includes('deepseek') || model.includes('r1')) {
|
||||||
|
document.getElementById('avatar-observer')?.classList.add('active');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active'));
|
|
||||||
const model = data.model || '';
|
|
||||||
const p = data.prompt ? data.prompt.toLowerCase() : '';
|
|
||||||
|
|
||||||
if (p.includes('tiiminvetäjä') || p.includes('pilko')) {
|
|
||||||
document.getElementById('avatar-kpn')?.classList.add('active');
|
|
||||||
} else if (p.includes('arvioi seuraava koodi') || p.includes('ohjelmiston julkaisu')) {
|
|
||||||
document.getElementById('avatar-tester')?.classList.add('active');
|
|
||||||
} else if (p.includes('tervehdi')) {
|
|
||||||
document.getElementById('avatar-client')?.classList.add('active');
|
|
||||||
} else if (p.includes('test')) {
|
|
||||||
document.getElementById('avatar-qa')?.classList.add('active');
|
|
||||||
} else if (model.includes('coder') || model.includes('Coder')) {
|
|
||||||
// Koodari aktivoituu, jos kyse on suoraan koodarille osoitetusta mallitehtävästä (esim. network task)
|
|
||||||
document.getElementById('avatar-coder')?.classList.add('active');
|
|
||||||
} else if (model.includes('deepseek') || model.includes('r1')) {
|
|
||||||
document.getElementById('avatar-observer')?.classList.add('active');
|
|
||||||
}
|
|
||||||
// Emme enää aseta oletusagenttia, jottei tuntemattomissa verkkopyynnöissä mikään turhaan hypi silmille.
|
|
||||||
}
|
}
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user