Skip to content

test: cover read_template and create_workspace allowlist enforcement#23645

Draft
johnstcn wants to merge 1 commit intomainfrom
cian/test-allowlist-read-create
Draft

test: cover read_template and create_workspace allowlist enforcement#23645
johnstcn wants to merge 1 commit intomainfrom
cian/test-allowlist-read-create

Conversation

@johnstcn
Copy link
Member

@johnstcn johnstcn commented Mar 25, 2026

  • Extend TestChatTemplateAllowlistEnforcement to also exercise read_template and create_workspace through the allowlist
  • Mock LLM now chains 4 tool calls: list_templates, read_template (blocked), read_template (allowed), create_workspace (blocked)
  • Wire dummy CreateWorkspace config into test server so the tool reaches the allowlist check
  • Generalize tool result collection to support multiple calls per tool name

🤖 Created by Coder Agents and reviewed by me.

… and create_workspace too)

Extend TestChatTemplateAllowlistEnforcement to cover read_template
and create_workspace in addition to list_templates. The mock LLM
now chains four tool calls through the allowlist gauntlet:

- list_templates: only the blessed template survives
- read_template with a blocked ID: rejected with not-found
- read_template with an allowed ID: details returned
- create_workspace with a blocked ID: rejected before CreateFn

Also wires a dummy CreateWorkspace into the test server so the tool
actually reaches the allowlist check instead of bailing early.
@johnstcn johnstcn self-assigned this Mar 25, 2026
@johnstcn johnstcn changed the title [DNM] test(coderd/x/chatd): cover read_template and create_workspace allowlist enforcement test(coderd/x/chatd): cover read_template and create_workspace allowlist enforcement Mar 26, 2026
@johnstcn johnstcn changed the title test(coderd/x/chatd): cover read_template and create_workspace allowlist enforcement test: cover read_template and create_workspace allowlist enforcement Mar 26, 2026
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.

1 participant