Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(dogfood/coder): allow mutable ai_prompt parameter#19493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 3 commits intomainfromcj/dogfood/prompt-mutable
Aug 22, 2025

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedAug 22, 2025
edited by coderabbitaibot
Loading

Summary by CodeRabbit

  • New Features

    • The AI Prompt setting is now editable after initial setup, allowing on-the-fly adjustments from the interface.
    • Updates to this setting no longer require recreating environments or configurations.
  • Bug Fixes

    • Improved handling when applying presets or prebuilt configurations that previously prevented editing the AI Prompt.

@coderabbitaicoderabbitai
Copy link

coderabbitaibot commentedAug 22, 2025
edited
Loading

Walkthrough

The Terraform data blockdata "coder_parameter" "ai_prompt" indogfood/coder/main.tf was changed to setmutable = true and an inline comment was added. No other files or logic were modified.

Changes

Cohort / File(s)Summary
Coder parameter mutability
dogfood/coder/main.tf
Changeddata "coder_parameter" "ai_prompt" attributemutable fromfalse totrue; added inline comment:// Workaround for issue with claiming a prebuild from a preset that does not include this parameter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nudge a flag from false to true,
A tiny hop through Terraform dew.
Carrots align, configs agree,
Mutable now—so prompt and free! 🥕
I twitch my whiskers, merge and go.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from theIntegrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between952ba06 and261dcb2.

📒 Files selected for processing (1)
  • dogfood/coder/main.tf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • dogfood/coder/main.tf
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint
  • GitHub Check: build_image
  • GitHub Check: gen
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branchcj/dogfood/prompt-mutable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag@coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag@coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on oursupport page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type@coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add@coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add@coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add@coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a.coderabbit.yaml file to the root of your repository.
  • Please see theconfiguration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit ourStatus Page to check the current availability of CodeRabbit.
  • Visit ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should it be made mutable only for prebuild/claim? If it's mutable for a claimed stopped workspace, that makes me wonder what should happen once it comes up. 😅

@johnstcn
Copy link
MemberAuthor

Should it be made mutable only for prebuild/claim? If it's mutable for a claimed stopped workspace, that makes me wonder what should happen once it comes up. 😅

I'd imagine that when we go to 'resume' a task, we might want to add some previous context to the input.

Copy link

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
dogfood/coder/main.tf (2)

41-42:Guard against whitespace-only prompts when toggling AI features

Today, any non-empty string (including whitespace) flips local.has_ai_prompt to true and enables the Claude-related resources. Trim the value before checking emptiness to avoid accidental enablement.

-  has_ai_prompt  = data.coder_parameter.ai_prompt.value != ""+  has_ai_prompt  = trimspace(data.coder_parameter.ai_prompt.value) != ""

252-258:Optional: add prompt-length validation to prevent oversized env vars

The prompt is surfaced as an environment variable (CODER_MCP_CLAUDE_TASK_PROMPT). Extremely large values can exceed shell/process limits or bloat plans. If the provider supports string validation for coder_parameter, consider enforcing a reasonable max length; otherwise, we can trim on assignment.

Option A (preferred, if supported by the provider): add a validation block.

 data "coder_parameter" "ai_prompt" {   type        = "string"   name        = "AI Prompt"   default     = ""   description = "Prompt for Claude Code"+  validation {+    # Keep prompts to <= 4000 chars to avoid oversized env vars.+    # If regex validation for strings is supported, enforce it here.+    # regex = "^(?s).{0,4000}$"+    # message = "Prompt must be 4000 characters or fewer."+  }   mutable     = true // You may wish to change the prompt, so mutability here is desirable. }

Option B (fallback): trim and hard-cap when setting the env value (silent truncate).

 resource "coder_env" "claude_task_prompt" {   count    = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0   agent_id = coder_agent.dev.id   name     = "CODER_MCP_CLAUDE_TASK_PROMPT"-  value    = data.coder_parameter.ai_prompt.value+  value    = substr(trimspace(data.coder_parameter.ai_prompt.value), 0, 4000) }

Can you confirm whether the coder provider supports string regex validation on parameters? If so, I’ll post a precise regex and message.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between5e49d8c and952ba06.

📒 Files selected for processing (1)
  • dogfood/coder/main.tf (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint
  • GitHub Check: gen
  • GitHub Check: build_image
🔇 Additional comments (1)
dogfood/coder/main.tf (1)

257-257:Change looks good: enabling mutability for AI prompt is consistent with intended UX

Allowing mid-workspace edits to the AI task prompt is desirable and aligns with how related parameters here are already marked mutable.

@johnstcnjohnstcn merged commitfe36e9c intomainAug 22, 2025
29 checks passed
@johnstcnjohnstcn deleted the cj/dogfood/prompt-mutable branchAugust 22, 2025 14:08
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@DanielleMaywoodDanielleMaywoodDanielleMaywood approved these changes

+1 more reviewer

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

Reviewers whose approvals may not affect merge requirements
Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp