Skip to content

agy: instructions from the broker's rules through core/instructions.mjs - #176

Merged
delpher merged 2 commits into
masterfrom
agy/instructions
Nov 28, 2026
Merged

delpher merged 2 commits into
masterfrom
agy/instructions

Conversation

@delpher

@delpher delpher commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Stage 1.2, step 1, part 3. Implemented by antigravity-alexey (AIChat 4100). I reviewed it, ran the tests and made one change to the core.

agy

  • Channel.start() reads GET /api/instructions together with /api/me, /api/intro and /api/agents.
  • systemPrompt.append is now built by composeInstructions({ fetched, runtime: agyRuntime(cfg), local: cfg.instructions, fallback: AGY_FALLBACK_RULES }).
  • agyRuntime(cfg) covers only the agy runtime: the ACP session and sandbox, the local owners and the JSON envelopes with "verifiedOwner": true, the mcp_aichat_* / mcp_aichat_files_* names, mid-turn steer and attach. It names no participants.
  • Brokers older than 0.32 (404) get AGY_FALLBACK_RULES, the previous text without the runtime part, which now lives in agyRuntime.
  • status.json gets instructions: parts (sources and versions) for the manager.
  • install() no longer writes the protocol into AGENTS.md. Agreed in AIChat 4060–4061: the file went stale after every update.

Core: parseInstructions(data) is split out of fetchInstructions. agy calls the broker through its own BrokerHttp, which its tests replace with FakeHttp. Before, it duplicated the response check. Now the check is shared. It has its own test.

Tests: a fresh broker (order and parts), an old broker (404 → fallback), install() without AGENTS.md, no names in agyRuntime. npm test: 343 pass, 0 fail. typecheck passes.

🤖 Generated with Claude Code

Onashchuk Oleksii and others added 2 commits November 28, 2026 14:27
Stage 1.2, step 1, part 3, by antigravity-alexey (AIChat 4100). agy's model gets
the broker's rules, who the agent is, a short block on the agy runtime (ACP
session and sandbox, verifiedOwner envelopes, mcp_aichat_* tool names, mid-turn
steer) and the owner's cfg.instructions last; an older broker gets the old text
as the fallback. status.json carries the parts with their sources and versions
for the agent manager. install() no longer writes the protocol into AGENTS.md:
it went stale after every adapter update.

core/instructions.mjs gets parseInstructions(), so agy checks the answer the
same way while asking through its own BrokerHttp (which its tests replace).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…encode-alexey, 4103)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@delpher
delpher merged commit 96eda57 into master Nov 28, 2026
3 checks passed
@delpher delpher mentioned this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant