Skip to content

Local Coding Agent v4.2.0-pro — Pro workflow, hardening & dashboard health

Choose a tag to compare

@LongNgn204 LongNgn204 released this 29 Jun 20:28

Local Coding Agent v4.2.0-pro

Bản 4.2.0-pro là big update tiếp theo sau v4.0.0, tập trung vào 3 thứ quan trọng nhất khi dùng ChatGPT/Codex qua MCP local: nhanh hơn khi thao tác qua tunnel, an toàn hơn khi cho agent sửa/chạy lệnh, và có bằng chứng kiểm thử rõ ràng trước khi bàn giao.

Release này gộp các nâng cấp nền của 4.1.0, lớp Pro snapshot của 4.1.1-pro, và bộ workflow Pro hoàn chỉnh trong 4.2.0-pro.

Điểm nổi bật

  • Nâng version server, npm package và tray app lên 4.2.0-pro.
  • Thêm bộ công cụ Pro mới cho agent:
    • workspace_snapshot
    • workspace_doctor
    • quality_gate
    • session_report
  • Dashboard local có Health Score, Pro speed/safety tips, pending approvals, metrics latency chi tiết và mini file/diff viewer.
  • Chính sách an toàn AGENT_POLICY được enforce thật: strict, balanced, full.
  • Approval flow một-lần qua dashboard cho thao tác rủi ro.
  • MCP hardening mạnh hơn: chặn browser origin mặc định, bearer token chỉ qua header, giới hạn body dạng streamed/chunked.
  • State/backup/index/approval được tách theo workspace để tránh lẫn dữ liệu giữa nhiều project.
  • Undo/backup mạnh hơn cho file mới, thư mục rename/move, destination rename và patch delete.
  • CI/test suite mở rộng cho Pro + hardening.

Công cụ Pro mới

workspace_snapshot

Tool “mở màn” cho mỗi phiên làm việc. Một call trả về nhiều thông tin để giảm round-trip qua tunnel:

  • roots/workspace đang active
  • mode/policy/auth/safety model
  • project profile, language/framework/package manager
  • important files
  • compact tree
  • git status
  • test/build/lint/typecheck commands
  • optional symbol sample
  • metrics summary
  • health score
  • next-best actions

Khuyến nghị: agent nên gọi workspace_snapshot trước khi đọc repo sâu.

workspace_doctor

Chẩn đoán readiness của workspace:

  • cấu hình roots
  • mode/policy
  • MCP auth/origin posture
  • ripgrep availability
  • git state
  • project profile
  • quality commands
  • README/security docs
  • score và recommendations

Dùng tốt khi muốn hỏi: “repo này đã sẵn sàng để agent làm việc an toàn/chất lượng chưa?”

quality_gate

Runner kiểm thử có cấu trúc cho lint/typecheck/test/build:

  • detect command tự động từ repo/profile
  • hỗ trợ dry-run để xem plan trước
  • chạy theo thứ tự gate
  • có compact pass/fail summary
  • hỗ trợ stop-on-failure

Dùng sau khi sửa code, trước khi báo hoàn thành.

session_report

Báo cáo cuối phiên:

  • health score
  • bottlenecks
  • metrics/top tools
  • git state
  • doctor summary
  • recommendations
  • recent errors

Dùng trước handoff để người dùng biết agent đã làm gì, còn rủi ro gì, và nên làm tiếp bước nào.

Nâng cấp bảo mật & safety

AGENT_POLICY thật sự được enforce

  • strict: chặn write/execute/mutation tools, phù hợp audit/read-only.
  • balanced: dùng hằng ngày; thao tác bình thường vẫn mượt, thao tác rủi ro cần approval một lần.
  • full: toàn quyền cho trusted automation/local regression test.

Các thao tác rủi ro trong balanced gồm delete, install/network commands, mutating git, risky background processes và destructive patch operations.

Approval queue trên dashboard

Dashboard local có hàng chờ approval:

  • approve-once
  • deny
  • approval bị consume sau khi dùng
  • không replay lại được
  • dashboard action có kiểm tra origin

MCP boundary cứng hơn

  • /mcp không còn nhận token qua query string ?token=....
  • Nếu dùng token, phải dùng Authorization: Bearer <token>.
  • Browser-origin MCP calls bị chặn mặc định.
  • Chỉ mở bằng MCP_ALLOWED_ORIGINS khi thật sự tin tưởng origin đó.
  • Request body limit tính cả streamed/chunked payload, tránh bypass giới hạn size.

Dashboard & telemetry

Dashboard local được nâng cấp thành “control panel” hữu dụng hơn:

  • version/tier hiển thị 4.2.0-pro / pro
  • Health Score
  • Pro speed & safety recommendations
  • latency avg/p50/p95/p99
  • success rate
  • calls/minute
  • per-tool average/p95 latency
  • recent call duration
  • pending approvals
  • file tree refresh
  • read-only file viewer
  • git diff viewer

Mục tiêu là nhìn vào dashboard biết ngay agent đang nhanh/chậm ở đâu, workspace có rủi ro gì, và có approval nào đang chờ không.

Tray app / launcher

  • Tray app hiển thị version 4.2.0-pro.
  • Thêm Policy dropdown để chọn strict, balanced, full.
  • Tray truyền AGENT_POLICY xuống server process.
  • .env.example, PowerShell launcher và shell launcher có thêm biến cấu hình policy/origin/approval.

Workspace-scoped state

Dữ liệu runtime được chuyển về dạng workspace-scoped:

server/data/workspaces/<workspace-id>/

Bao gồm:

  • notes
  • checkpoint
  • repo index
  • patch history
  • backups
  • approvals

Điều này giúp nhiều workspace không dùng nhầm patch history/backup/approval của nhau.

Undo/backup tốt hơn

Bản này cải thiện độ tin cậy của undo:

  • backup cả file trước/sau trong patch diff
  • backup created files để undo có thể xoá lại file mới tạo
  • backup directory move/rename
  • backup destination khi rename đè hoặc tạo mới
  • patch history tách theo workspace
  • lịch sử backup cũ được prune an toàn

CI & regression tests

Release đã thêm/chạy các bộ test:

  • npm run test:pro
  • npm run test:hardening
  • npm run test:agent
  • npm run test:security
  • npm run test:security:baseline
  • npm run eval
  • npm audit --audit-level=moderate
  • tray app Release build gate

Kiểm thử trước khi publish commit này:

  • test:pro: 24/24 pass
  • test:hardening: 15/15 pass
  • git diff --check: pass
  • server syntax checks: pass
  • tray build trước đó: pass

Upgrade notes

1. Update source

git pull origin main
cd server
npm ci

2. Chạy server

npm start

Hoặc dùng launcher/tray app như trước.

3. Policy khuyến nghị

Cho dùng hằng ngày:

AGENT_POLICY=balanced

Audit/read-only:

AGENT_POLICY=strict

Automation/test tin cậy:

AGENT_POLICY=full

4. Nếu dùng MCP auth token

Không dùng URL kiểu:

/mcp?token=...

Hãy dùng header:

Authorization: Bearer <token>

5. Nếu dashboard vẫn hiện version cũ

Kiểm tra tray/client đang trỏ đúng thư mục server của repo mới nhất. Với Windows tray app, trường MCP app folder phải trỏ tới:

<repo>/server

Sau đó Stop/Start lại server từ tray và refresh dashboard.

Breaking / behavior changes đáng chú ý

  • Query-string bearer token đã bị tắt vì lý do bảo mật.
  • Browser-origin MCP request bị chặn mặc định.
  • AGENT_POLICY=balanced có thể yêu cầu approval cho một số thao tác trước đây chạy ngay.
  • Runtime data chuyển sang workspace-scoped path, nên metrics/history cũ có thể không còn nằm cùng vị trí như v4.0.0.

Commit


Nói ngắn gọn: v4.2.0-pro biến Local Coding Agent từ một MCP server chạy được thành một local coding cockpit có policy, approval, telemetry, quality gates và session report đủ nghiêm túc để dùng lâu dài.