But wait.. if the chatbot is writing then code then it is not you who is writing the code, but the chatbot.

That would be true if you were vibe coding. However “normal” agentic development is a little more like “pair programming” in my opinion.