Skip to content

Commit 9e7a625

Browse files
Testclaude
andcommitted
feat(frontend): route AGENT_LOG tool events to CEO conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c210b44 commit 9e7a625

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

frontend/app.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,41 @@ class AppController {
509509
// Skip if REST fetch is in-flight (renderLogs will do a full refresh)
510510
if (this._logFetchInFlight) return null;
511511
if (this._empXterm) {
512-
this._empXterm.appendLog(p.log);
512+
// Employee xterm still receives string content
513+
const xtermLog = { ...p.log };
514+
if (typeof xtermLog.content === 'object' && xtermLog.content !== null) {
515+
xtermLog.content = xtermLog.content.content || JSON.stringify(xtermLog.content);
516+
}
517+
this._empXterm.appendLog(xtermLog);
518+
}
519+
}
520+
521+
// CEO conversation: route tool_call / tool_result events
522+
if (p.project_id && this._ceoTerm && this._currentCeoProject) {
523+
const currentBase = this._currentCeoProject.split('/')[0];
524+
const eventBase = p.project_id.split('/')[0];
525+
if (currentBase === eventBase) {
526+
if (p.log?.type === 'tool_call') {
527+
const content = p.log.content;
528+
if (typeof content === 'object' && content !== null) {
529+
this._ceoTerm.appendToolCall({
530+
employeeId: p.employee_id,
531+
toolName: content.tool_name || '?',
532+
toolArgs: content.tool_args || {},
533+
});
534+
}
535+
} else if (p.log?.type === 'tool_result') {
536+
const content = p.log.content;
537+
if (typeof content === 'object' && content !== null) {
538+
this._ceoTerm.updateToolCall(p.employee_id, {
539+
toolName: content.tool_name || '?',
540+
toolResult: content.tool_result || '',
541+
});
542+
}
543+
}
513544
}
514545
}
546+
515547
return null; // don't spam the activity log
516548
},
517549
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@1mancompany/onemancompany",
3-
"version": "0.4.41",
3+
"version": "0.4.42",
44
"description": "The AI Operating System for One-Person Companies",
55
"bin": {
66
"onemancompany": "bin/cli.js"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onemancompany"
3-
version = "0.4.41"
3+
version = "0.4.42"
44
description = "A one-man company simulation with pixel art visualization and LangChain AI agents"
55
requires-python = ">=3.12"
66
dependencies = [

0 commit comments

Comments
 (0)