Commit 4e5d7e8
路旦
fix: Avoid modifying original config in AgentBuilder._build()
- Replace pop() operations with dictionary comprehension
- Create filtered config dict to avoid side effects
- Improve code clarity and maintainability
The previous implementation used pop() which modified the original
config dict passed to _build(). This could cause issues if the caller
retained a reference to the config or wanted to reuse it.
The new implementation uses dictionary comprehension to create a new
dict excluding 'sub_agents' and 'tools', which are passed explicitly
as parameters to avoid conflicts.1 parent c5e7293 commit 4e5d7e8
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
0 commit comments