Skip to content

fix(types): describe pipeline response results - #2068

Merged
nijel merged 1 commit into
masterfrom
types
Oct 6, 2026
Merged

nijel merged 1 commit into
masterfrom
types

Conversation

@nijel

@nijel nijel commented Oct 6, 2026

Copy link
Copy Markdown
Member

Pipeline steps can stop execution by returning an HTTP response, but the dictionary-only annotation rejected valid redirect results. Align pipeline, disconnect, and partial annotations with this behavior and preserve callback result types without casts.

Pipeline steps can stop execution by returning an HTTP response, but the dictionary-only annotation rejected valid redirect results. Align pipeline, disconnect, and partial annotations with this behavior and preserve callback result types without casts.
@nijel nijel self-assigned this Oct 6, 2026
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.31%. Comparing base (7544f69) to head (28d5a3d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2068   +/-   ##
=======================================
  Coverage   96.30%   96.31%           
=======================================
  Files         370      370           
  Lines       20753    20797   +44     
  Branches     1207     1208    +1     
=======================================
+ Hits        19987    20031   +44     
  Misses        565      565           
  Partials      201      201           
Flag Coverage Δ
unittests 96.31% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nijel
nijel enabled auto-merge (rebase) October 6, 2026 15:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T15:17:55.366112Z 28d5a3d PR opened
🔒 Security Review ✅ Completed 2026-10-06T15:15:59.751734Z 28d5a3d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28d5a3d7b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


def pipeline(
self, pipeline, pipeline_index: int = 0, *args, **kwargs
self, pipeline: list[str], pipeline_index: int = 0, *args, **kwargs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept tuple pipeline configurations in the annotation

Use a sequence-compatible type rather than list[str] here. The built-in DEFAULT_AUTH_PIPELINE is a tuple, configured pipelines are commonly tuples, and the implementation only requires slicing and iteration, so backend.pipeline(DEFAULT_AUTH_PIPELINE) remains valid at runtime but is now incorrectly rejected by type checkers. The cast in BaseStrategy.get_pipeline() merely hides the same mismatch for internal calls instead of converting the tuple.

Useful? React with 👍 / 👎.

def partial_step(
save_to_session: bool, allow_external_resume: bool = False
) -> Callable[
[Callable[..., dict[str, Any] | HttpResponseProtocol | None]],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow supported falsy partial-step results

Broaden the accepted callback return type to include falsy non-dictionary results. Pipeline steps returning False, 0, or "" are explicitly supported as no-op results—the wrapper normalizes them to {} and run_pipeline() continues—but this new decorator annotation makes type checkers reject an otherwise valid annotated partial step such as def step(...) -> bool: return False.

Useful? React with 👍 / 👎.

@nijel
nijel merged commit fde0cf8 into master Oct 6, 2026
37 checks passed
@nijel
nijel deleted the types branch October 6, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant