Skip to content

fix(cdk): Remove remediation language from generic 400 error message (AI-Triage PR)#944

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773146540-improve-400-error-message
Draft

fix(cdk): Remove remediation language from generic 400 error message (AI-Triage PR)#944
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1773146540-improve-400-error-message

Conversation

@devin-ai-integration
Copy link
Contributor

fix(cdk): Remove remediation language from generic 400 error message (AI-Triage PR)

Summary

Simplifies the CDK's default 400 error message from "HTTP Status Code: 400. Error: Bad request. Please check your request parameters." to "Bad request.".

The old message violated error message guidelines:

  • Embedded remediation language ("Please check your request parameters")
  • Redundant HTTP status code prefix (already available in logs/UI context)

This is the generic fallback for any connector that doesn't define a custom HttpResponseFilter for 400 responses. Connectors that need API-specific context should add their own HttpResponseFilter with interpolated error messages (e.g., {{ response.message }}).

Related to https://github.com/airbytehq/airbyte-internal-issues/issues/15976
Related to https://github.com/airbytehq/oncall/issues/11577

Review & Testing Checklist for Human

  • Is "Bad request." too terse? The old message was unhelpful but at least verbose. Consider whether a middle ground like "Bad request. The server rejected the request." would be better, or whether brevity is preferred since connectors should override this with specific messages via HttpResponseFilter.
  • FailureType is still system_error — a 400 is often a config_error (bad user-provided parameters). This PR does not change the classification. Verify this is intentional / acceptable to defer.
  • Inconsistency with other messages — Other entries in default_error_mapping.py (e.g., 403, 429) still use the "HTTP Status Code: X. Error: ..." pattern. Confirm whether this inconsistency is acceptable or if a broader cleanup is expected.

Notes

  • This is a Draft PR created during AI triage of an oncall issue. It addresses only the CDK-level generic message; the connector-level fix (adding an HttpResponseFilter to source-paypal-transaction's list_disputes stream) is tracked separately.
  • Unit tests updated and passing locally (26/26).

Requested by: bot_apk
Devin session

The default 400 error message contained 'Please check your request
parameters' which violates the writing-good-error-messages guidelines:
- Embeds remediation language ('Please check...')
- Redundantly prefixes with 'HTTP Status Code: 400. Error:'
- Not specific enough to be actionable

Simplified to 'Bad request.' which is concise and does not embed
unhelpful remediation suggestions. Connectors should use
HttpResponseFilter with custom error_message templates to provide
API-specific context for 400 errors.

Related to airbytehq/airbyte-internal-issues#15976
Related to airbytehq/oncall#11577

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1773146540-improve-400-error-message#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1773146540-improve-400-error-message

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link

PyTest Results (Fast)

3 892 tests  ±0   3 880 ✅ ±0   6m 49s ⏱️ +3s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit fdf7a58. ± Comparison against base commit f550424.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-HTTP Status Code: 400. Error: Bad request. Please check your request parameters.]
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-Bad request.]

@github-actions
Copy link

PyTest Results (Full)

3 895 tests  ±0   3 883 ✅ ±0   11m 13s ⏱️ -1s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit fdf7a58. ± Comparison against base commit f550424.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-HTTP Status Code: 400. Error: Bad request. Please check your request parameters.]
unit_tests.sources.declarative.requesters.error_handlers.test_default_error_handler ‑ test_default_error_handler_with_custom_response_filter[_with_http_response_status_400_fail_with_default_failure_type-400-test_response_filter0-ResponseAction.RETRY-FailureType.system_error-Bad request.]

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.

0 participants