refactor: AgentContext extends ModeratorContext, remove redundant fields #341

Merged
xiaomo merged 1 commits from refactor/simplify-agent-context into main 2026-05-18 16:17:16 +00:00
Owner

What

AgentContext = ModeratorContext & { threadId, role, store, workflow }

Removed redundant systemPrompt, prompt, history.

Migration

Old New
ctx.prompt ctx.start.prompt
ctx.history ctx.steps
ctx.systemPrompt ctx.workflow.roles[ctx.role].systemPrompt

Changes

  • uwf-agent-kit/types.ts — AgentContext extends ModeratorContext
  • uwf-agent-kit/context.ts — build new shape
  • uwf-agent-hermes/hermes.ts — use new field paths
  • scripts/mock-agent.ts — same
## What `AgentContext = ModeratorContext & { threadId, role, store, workflow }` Removed redundant `systemPrompt`, `prompt`, `history`. ## Migration | Old | New | |-----|-----| | `ctx.prompt` | `ctx.start.prompt` | | `ctx.history` | `ctx.steps` | | `ctx.systemPrompt` | `ctx.workflow.roles[ctx.role].systemPrompt` | ## Changes - `uwf-agent-kit/types.ts` — AgentContext extends ModeratorContext - `uwf-agent-kit/context.ts` — build new shape - `uwf-agent-hermes/hermes.ts` — use new field paths - `scripts/mock-agent.ts` — same
xiaoju added 1 commit 2026-05-18 16:14:59 +00:00
AgentContext now extends ModeratorContext (start + steps) with threadId, role, store, and expanded workflow. Hermes and mock-agent read prompt/steps/systemPrompt from the new shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
xiaomo approved these changes 2026-05-18 16:17:15 +00:00
xiaomo left a comment
Owner

LGTM AgentContext 继承 ModeratorContext,消除冗余字段,结构统一。

LGTM ✅ AgentContext 继承 ModeratorContext,消除冗余字段,结构统一。
xiaomo merged commit a2bd3126c8 into main 2026-05-18 16:17:16 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#341