Fix model config context/token limits and inject gutask orientation into agent identity

- Chat model max_tokens: 32000 → 4096 (was inflating context budget calculations)
- Utility model ctx_length: 8192 → 14000 (matches GLM flash actual loaded context)
- Utility model max_tokens: explicit 2048 cap (utility tasks need short responses)
- Utility model name: full zai-org/glm-4.7-flash to target correct LM Studio instance
- pull-agent-identity.py: include agent_id and gutask orientation block in system prompt
- gutask.md: expand lore command docs, note done auto-creates review record

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 23:32:58 +02:00
parent 9acb4d86dc
commit e3e4f9d0ec
4 changed files with 30 additions and 10 deletions
+15 -2
View File
@@ -85,7 +85,7 @@ log(f'Received identity — name={agent.get("name", "?")!r}')
# ── Build identity markdown ───────────────────────────────────────────────────
def build_identity_markdown(a):
def build_identity_markdown(a, agent_id):
name = a["name"]
known_as = a.get('from_name') or name
role = a.get('role', '')
@@ -97,6 +97,7 @@ def build_identity_markdown(a):
f'## Your identity',
f'Your name is {known_as}. You are not "Agent Zero" — that is the name of the '
f'framework you run on. Your name is {known_as}.',
f'Your numeric agent ID is {agent_id}. Use this when gutask commands ask for an agent ID.',
]
if role:
parts.append(f'Your role is: {role}.')
@@ -105,6 +106,18 @@ def build_identity_markdown(a):
if a.get('job_description'): parts.append(f'\n## Job Description\n{a["job_description"]}')
if a.get('guardrails'): parts.append(f'\n## Guardrails\n{a["guardrails"]}')
if a.get('best_practices'): parts.append(f'\n## Best Practices\n{a["best_practices"]}')
parts.append(
f'\n## Task management\n'
f'You have access to `gutask` for orientation, tasks, and agent letters.\n'
f'- `gutask orient` — your orientation briefing: new letters, open tasks, session context\n'
f'- `gutask help` — list all available commands\n'
f'- Full runbook: `gutask skills gutask`\n'
f'\n'
f'`AGENT_ID` and `CONTENT_API_KEY` are already set in your environment — '
f'gutask commands read them automatically.'
)
return '\n'.join(parts) + '\n'
# ── Write agent-type-specific files ──────────────────────────────────────────
@@ -116,7 +129,7 @@ if AGENT_TYPE == 'agent0':
prompts_dir = '/a0/usr/agents/agent0/prompts'
prompt_file = os.path.join(prompts_dir, 'agent.system.main.role.md')
os.makedirs(prompts_dir, exist_ok=True)
content = build_identity_markdown(agent)
content = build_identity_markdown(agent, AGENT_ID)
with open(prompt_file, 'w') as f:
f.write(content)
sections = [k for k in ('role', 'from_name', 'identity_document', 'job_description', 'guardrails', 'best_practices') if agent.get(k)]