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
@@ -11,7 +11,7 @@
"rl_input": 0,
"rl_output": 0,
"kwargs": {
"max_tokens": 32000,
"max_tokens": 4096,
"agent_id": 3
},
"max_embeds": 10
@@ -20,12 +20,14 @@
"provider": "lm_studio",
"name": "zai-org/glm-4.7-flash",
"api_base": "http://host.docker.internal:1234/v1",
"ctx_length": 8192,
"ctx_length": 14000,
"ctx_input": 0.7,
"rl_requests": 0,
"rl_input": 0,
"rl_output": 0,
"kwargs": {}
"kwargs": {
"max_tokens": 2048
}
},
"embedding_model": {
"provider": "huggingface",
@@ -11,7 +11,7 @@
"rl_input": 0,
"rl_output": 0,
"kwargs": {
"max_tokens": 32000,
"max_tokens": 4096,
"agent_id": 8
},
"max_embeds": 10
@@ -20,12 +20,14 @@
"provider": "lm_studio",
"name": "zai-org/glm-4.7-flash",
"api_base": "http://host.docker.internal:1234/v1",
"ctx_length": 8192,
"ctx_length": 14000,
"ctx_input": 0.7,
"rl_requests": 0,
"rl_input": 0,
"rl_output": 0,
"kwargs": {}
"kwargs": {
"max_tokens": 2048
}
},
"embedding_model": {
"provider": "huggingface",
+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)]
+5 -2
View File
@@ -43,7 +43,7 @@ gutask next # highest-priority todo task
gutask get <id> # single task detail
gutask claim <id> # claim a task (todo → in_progress)
gutask done <id> # mark done
gutask done <id> # mark done — also auto-creates a review record
gutask blocked <id> # mark blocked
gutask create \
@@ -124,7 +124,10 @@ Use `-ispart` for membership/containment (IS PART OF).
## Other commands
```bash
gutask lore # browse Glitch University lore
gutask lore # list all lore nodes
gutask lore <id> # show a specific lore node in full (e.g. gutask lore 41)
gutask lore --id <id> # same as above
gutask lore --search "keyword" # search lore by keyword
gutask skills # list available skill runbooks
gutask skills <name> # display a specific skill
gutask agents # list all agents and their IDs