Skip to content

Error chains: wrong argument named, missing step for ContextProvider #570

Closed

Description

@lesnik512

This was generated by AI during a pre-4.0 audit of main at 9cd88e7.

1. Context error raised inside a creator body names the outer argument

Inner.__init__(self, c: Container) calls c.resolve(Tenant) (unset context); Outer(inner: Inner). Resolving Outer reports arg_name='inner', "needed for argument inner", and the chain lacks the Inner step. The except ContextValueNotSetError branch in the _TRANSIENT/_CACHED templates (resolver_compiler.py) names by tb_lineno of the frame it is in, but the error came from a nested resolve that already passed its own frame. Expected: the argument/step of the innermost resolver that raised; an error that already has arg_name set is not renamed.

2. Directly resolving a ContextProvider from too shallow a container has no step

resolver_compiler.py:277 calls find_container directly instead of _navigate, so the scope error names no provider, unlike Factory.

Acceptance

Failing tests first for both; message text checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions