Skip to content

🪲 BUG-#133: Fix co_varnames to only include parameters, not local variables#161

Merged
FernandoCelmer merged 2 commits intodevelopfrom
feature/133
Apr 7, 2026
Merged

🪲 BUG-#133: Fix co_varnames to only include parameters, not local variables#161
FernandoCelmer merged 2 commits intodevelopfrom
feature/133

Conversation

@FernandoCelmer
Copy link
Copy Markdown
Member

@FernandoCelmer FernandoCelmer commented Apr 7, 2026

Description

  • dotflow/core/action.py — Fix _set_params to slice co_varnames[:co_argcount + co_kwonlyargcount] instead of using the full co_varnames tuple

Motivation and Context

co_varnames includes all local variables, not just parameters. A function with a local variable named initial_context or previous_context would be falsely detected as having those parameters, triggering incorrect context injection.

The fix also accounts for keyword-only parameters (def step(*, initial_context):) via co_kwonlyargcount.

Closes #133

Types of changes

  • Bug fix (change that fixes an issue)
  • New feature (change which adds functionality)
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer added the bug Something isn't working label Apr 7, 2026
@FernandoCelmer FernandoCelmer merged commit 810264c into develop Apr 7, 2026
10 checks passed
@FernandoCelmer FernandoCelmer deleted the feature/133 branch April 7, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant