fix: address code review comments
Co-authored-by: abhi1693 <5083532+abhi1693@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ from app.models.boards import Board
|
||||
from app.models.tags import Tag
|
||||
from app.models.task_dependencies import TaskDependency
|
||||
from app.models.tasks import Task
|
||||
from app.schemas.agent_files import AgentFileUpdate
|
||||
from app.schemas.agents import (
|
||||
AgentCreate,
|
||||
AgentHeartbeat,
|
||||
@@ -1695,7 +1696,7 @@ async def read_agent_file(
|
||||
async def update_agent_file(
|
||||
agent_id: str,
|
||||
filename: str,
|
||||
payload: dict[str, str],
|
||||
payload: AgentFileUpdate,
|
||||
board: Board = BOARD_DEP,
|
||||
session: AsyncSession = SESSION_DEP,
|
||||
agent_ctx: AgentAuthContext = AGENT_CTX_DEP,
|
||||
@@ -1706,17 +1707,14 @@ async def update_agent_file(
|
||||
"""
|
||||
_guard_board_access(agent_ctx, board)
|
||||
_require_board_lead(agent_ctx)
|
||||
|
||||
content = payload.get("content", "")
|
||||
reason = payload.get("reason")
|
||||
|
||||
|
||||
coordination = GatewayCoordinationService(session)
|
||||
await coordination.update_agent_file(
|
||||
board=board,
|
||||
target_agent_id=agent_id,
|
||||
filename=filename,
|
||||
content=content,
|
||||
reason=reason,
|
||||
content=payload.content,
|
||||
reason=payload.reason,
|
||||
actor_agent_id=agent_ctx.agent.id,
|
||||
correlation_id=f"file.write:{board.id}:{agent_id}:{filename}",
|
||||
)
|
||||
|
||||
@@ -27,6 +27,11 @@ import {
|
||||
import { useOrganizationMembership } from "@/lib/use-organization-membership";
|
||||
import type { AgentRead } from "@/api/generated/model";
|
||||
|
||||
type AgentFile = {
|
||||
name: string;
|
||||
editable: boolean;
|
||||
};
|
||||
|
||||
export default function AgentFilesPage() {
|
||||
const { isSignedIn } = useAuth();
|
||||
const router = useRouter();
|
||||
@@ -36,7 +41,7 @@ export default function AgentFilesPage() {
|
||||
|
||||
const { isAdmin } = useOrganizationMembership(isSignedIn);
|
||||
|
||||
const [files, setFiles] = useState<Array<{ name: string; editable: boolean }>>([]);
|
||||
const [files, setFiles] = useState<AgentFile[]>([]);
|
||||
const [selectedFile, setSelectedFile] = useState<string | null>(null);
|
||||
const [fileContent, setFileContent] = useState("");
|
||||
const [editDialogOpen, setEditDialogOpen] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user