Skip to content

fix(pat): support batch agentCode and guarded grants#455

Merged
PeterGuy326 merged 5 commits into
DingTalk-Real-AI:mainfrom
shangguanxuan633-lab:codex/pat-batch-agentcode-pr
Jun 11, 2026
Merged

fix(pat): support batch agentCode and guarded grants#455
PeterGuy326 merged 5 commits into
DingTalk-Real-AI:mainfrom
shangguanxuan633-lab:codex/pat-batch-agentcode-pr

Conversation

@shangguanxuan633-lab

Copy link
Copy Markdown
Contributor

Summary

  • carry explicit --agentCode / DINGTALK_DWS_AGENTCODE into PAT batch plan/grant args
  • allow missing agentCode so PAT core can apply the server-side default
  • require explicit --yes before executing batch grants, while keeping dry-run and single-scope grants unchanged
  • keep only the canonical env name DINGTALK_DWS_AGENTCODE; ignore draft/reversed names

Validation

  • go test ./internal/pat ./test/unit -run 'TestChmod|TestResolveAgentCode|TestHandleToolResult|TestHostOwnsPATFlow|TestPAT'
  • prepub CLI smoke with DINGTALK_PAT_MCP_URL=https://pre-mcp-gw.dingtalk.com/server/abc3c880fb90f04b52d1426aaf093766e5fc9ec38411688cbb74df42a584d374
  • verified target agentCode=dinglqdkz3mmw2xwvend was returned by dry-run, single grant, flag-priority grant, and batch grant
  • verified DB agent_pat for uid=2010955235 contains 13 ACTIVE permanent rows for agent_code=dinglqdkz3mmw2xwvend

@PeterGuy326 PeterGuy326 merged commit 2a82d07 into DingTalk-Real-AI:main Jun 11, 2026
6 checks passed
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.

2 participants