8000 fix/guardrails: In enforced mode, hide smart apply, etc. actions until attribution complete by dominiccooney · Pull Request #7579 · sourcegraph/cody · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix/guardrails: In enforced mode, hide smart apply, etc. actions until attribution complete #7579

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

dominiccooney
Copy link
Contributor

When Guardrails is in "enforced" mode, we want to prevent the user from using code until an attribution check is complete. Hide the action buttons until it is OK to show the code.

For Guardrails "permissive" mode, or no Guardrails, showCode is always true and we will show the action buttons as soon as the code is complete.

This also bumps the timeout for Guardrails attribution requests. These requests can easily take 20s+ for long code blocks.

Fixes CODY-5552, CODY-5551

Test plan

Tested manually:

  1. Set up an instance with "attribution.enabled": true, "attribution.mode": "enforced" and connect to it.
  2. Generate more than 10 lines of code.
  3. Check that the action buttons do not appear while "Checking Guardrails"

@dominiccooney dominiccooney requested a review from a team March 27, 2025 08:20
@dominiccooney dominiccooney enabled auto-merge (squash) March 27, 2025 08:20
@dominiccooney dominiccooney merged commit df3abdd into main Mar 27, 2025
19 of 23 checks passed
@dominiccooney dominiccooney deleted the dpc/guardrails-copy-insert branch March 27, 2025 08:27
abeatrix pushed a commit that referenced this pull request Mar 27, 2025
…c. actions until attribution complete (#7581)

When Guardrails is in "enforced" mode, we want to prevent the
user from using code until an attribution check is complete. Hide the
action buttons until it is OK to show the code.

For Guardrails "permissive" mode, or no Guardrails, `showCode`
is always `true` and we will show the action buttons as soon as the code
is complete.

This also bumps the timeout for Guardrails attribution requests. These
requests can easily take 20s+ for long code blocks.

Fixes CODY-5552, CODY-5551

## Test plan

Tested manually:

1. Set up an instance with `"attribution.enabled": true,
"attribution.mode": "enforced"` and connect to it.
2. Generate more than 10 lines of code.
3. Check that the action buttons do not appear while "Checking
Guardrails&quot; <br> Backport df3abdd
from #7579

Co-authored-by: Dominic Cooney <dominic.cooney@sourcegraph.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0