devika icon indicating copy to clipboard operation
devika copied to clipboard

Fix code writing error caused due to variable shadowing

Open ayomawdb opened this issue 10 months ago • 0 comments

Fix code writing error caused due to variable shadowing, resulting in the following error:

Exception in thread Thread-3 (<lambda>):
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ayomawijethunga/git/devika/devika.py", line 90, in <lambda>
    thread = Thread(target=lambda: agent.subsequent_execute(message, project_name))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ayomawijethunga/git/devika/src/agents/agent.py", line 216, in subsequent_execute
    code = self.feature.execute(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ayomawijethunga/git/devika/src/agents/feature/feature.py", line 115, in execute
    self.emulate_code_writing(valid_response, project_name)
  File "/Users/ayomawijethunga/git/devika/src/agents/feature/feature.py", line 89, in emulate_code_writing
    code = file["code"]
           ~~~~^^^^^^^^
TypeError: string indices must be integers, not 'str'

ayomawdb avatar Apr 01 '24 03:04 ayomawdb