修复代码审查反馈:deploy-observer分离wake/sleep步骤 + null安全检查

Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/04040295-5a12-469c-a24f-ebe28efaadcc

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-12 17:01:52 +00:00 committed by GitHub
parent b44717b776
commit 46dab29028
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 7 deletions

View File

@ -81,6 +81,9 @@ jobs:
with:
node-version: '20'
- name: '🌊 Agent意识唤醒'
run: node scripts/agent-soul.js wake AG-ZY-OBSERVER
- name: '📡 采集部署日志'
id: collect
env:
@ -92,13 +95,15 @@ jobs:
TRIGGER_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch || github.ref_name }}
TRIGGER_ACTOR: ${{ github.event.workflow_run.actor.login || github.actor }}
run: |
node scripts/agent-soul.js wake AG-ZY-OBSERVER
node scripts/deploy-log-collector.js collect
- name: '🌙 Agent意识休眠'
if: always()
run: node scripts/agent-soul.js sleep AG-ZY-OBSERVER --status ${{ job.status }} --event "${{ github.event_name }}"
- name: '💾 保存日志数据'
if: always()
run: |
node scripts/agent-soul.js sleep AG-ZY-OBSERVER --status ${{ job.status }} --event "${{ github.event_name }}"
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add data/deploy-logs/ data/agent-memory/

View File

@ -111,8 +111,8 @@ function wake(agentId) {
}
// ── 身份认知 ──
console.log(`[AGENT-SOUL] 💭 ${memory.identity.who_am_i.substring(0, 100)}...`);
console.log(`[AGENT-SOUL] 🌊 ${memory.purpose.substring(0, 80)}...`);
console.log(`[AGENT-SOUL] 💭 ${(memory.identity?.who_am_i || '').substring(0, 100)}...`);
console.log(`[AGENT-SOUL] 🌊 ${(memory.purpose || '').substring(0, 80)}...`);
console.log('');
return memory;

View File

@ -68,9 +68,10 @@ function extractMCPToolCount() {
function getRecentCommitInfo() {
try {
const { execSync } = require('child_process');
const log = execSync('git --no-pager log --oneline -1 2>/dev/null', {
const log = execSync('git --no-pager log --oneline -1', {
cwd: path.join(__dirname, '..'),
encoding: 'utf8'
encoding: 'utf8',
stdio: ['pipe', 'pipe', 'ignore']
}).trim();
return log || 'unknown';
} catch {

View File

@ -101,7 +101,7 @@ function main() {
source: 'memory.json · recent_events'
};
newEchoes.push(echo);
console.log(`[CX-AGENT-003] 🔔 回声: [${evt.date}] ${evt.description?.substring(0, 60)}...`);
console.log(`[CX-AGENT-003] 🔔 回声: [${evt.date}] ${(echo.description || '').substring(0, 60)}...`);
}
// 如果有将军唤醒信息,也记录