mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
feat: add parentAgentId field to server types
Add parentAgentId field to enable agent parent/child hierarchy: - ManagedAgentBase in agent-manager.ts - AgentSessionConfig in agent-sdk-types.ts - AgentSnapshotPayloadSchema in messages.ts - toAgentPayload() in agent-projections.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,7 @@ type ManagedAgentBase = {
|
||||
lastUsage?: AgentUsage;
|
||||
lastError?: string;
|
||||
attention: AttentionState;
|
||||
parentAgentId?: string;
|
||||
};
|
||||
|
||||
type ManagedAgentWithSession = ManagedAgentBase & {
|
||||
|
||||
@@ -80,6 +80,7 @@ export function toAgentPayload(
|
||||
pendingPermissions: sanitizePendingPermissions(agent.pendingPermissions),
|
||||
persistence: sanitizePersistenceHandle(agent.persistence),
|
||||
title: options?.title ?? null,
|
||||
parentAgentId: agent.parentAgentId,
|
||||
};
|
||||
|
||||
const usage = sanitizeOptionalJsonValue<AgentUsage>(agent.lastUsage);
|
||||
|
||||
@@ -161,6 +161,7 @@ export type AgentSessionConfig = {
|
||||
claude?: Partial<ClaudeAgentOptions>;
|
||||
};
|
||||
mcpServers?: Record<string, unknown>;
|
||||
parentAgentId?: string;
|
||||
};
|
||||
|
||||
export interface AgentSession {
|
||||
|
||||
@@ -245,6 +245,7 @@ export const AgentSnapshotPayloadSchema = z.object({
|
||||
requiresAttention: z.boolean().optional(),
|
||||
attentionReason: z.enum(["finished", "error", "permission"]).nullable().optional(),
|
||||
attentionTimestamp: z.string().nullable().optional(),
|
||||
parentAgentId: z.string().optional(),
|
||||
});
|
||||
|
||||
export type AgentSnapshotPayload = z.infer<typeof AgentSnapshotPayloadSchema>;
|
||||
|
||||
3
plan.md
3
plan.md
@@ -292,12 +292,13 @@ Files requiring modification:
|
||||
|
||||
---
|
||||
|
||||
- [ ] **Implement**: Add parentAgentId field to server types.
|
||||
- [x] **Implement**: Add parentAgentId field to server types.
|
||||
|
||||
- Add `parentAgentId?: string` to `ManagedAgentBase` in `agent-manager.ts:77`
|
||||
- Add `parentAgentId?: string` to `AgentSessionConfig` in `agent-sdk-types.ts:148`
|
||||
- Update `toAgentPayload()` in `agent-projections.ts` to include `parentAgentId`
|
||||
- Run typecheck after changes.
|
||||
- **Done (2025-12-21 19:45)**: Added `parentAgentId?: string` to `ManagedAgentBase` in `agent-manager.ts:97`, `AgentSessionConfig` in `agent-sdk-types.ts:164`, and `AgentSnapshotPayloadSchema` in `messages.ts:248`. Updated `toAgentPayload()` in `agent-projections.ts:83` to include `parentAgentId` in the payload. Typecheck passes.
|
||||
|
||||
- [ ] **Implement**: Add parentAgentId to MCP create_agent tool.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user