Commit beecea7
wangziren
fix: align AgentSideConnection.to_agent type with AgentFactory
AgentSideConnection declares its factory parameter as
Callable[[Client], Agent] | Agent, but _prepare always invokes it with the
AgentSideConnection itself (to_agent(self)). The narrower
AgentFactory = Callable[[AgentSideConnection], Agent] used by AcpServer is
therefore not assignable to it under parameter contravariance, so a strict
type-checker consumer passing an AgentFactory into AgentSideConnection gets a
spurious type error (and has to cast).
Narrow the four to_agent declarations to
Callable[[AgentSideConnection], Agent] | Agent so they match AgentFactory, and
drop the now-unused Client import.1 parent 9d07d78 commit beecea7
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
0 commit comments