---
title: "Comment by YouBeyond on \"The Agent Converted the If/Else Chain to a Lookup Map and Dropped the Side Effect\" | Hashnode"
description: "There is another behavior change in this example: the original function returns a fresh object, while the lookup returns a shared object. If a caller mutates ti"
url: "https://hashnode.com/posts/agent-if-chain-to-lookup-map-drops-side-effect/6ad2c08c020cc1cf77f5e713/comment/6ad3204e08c7fa5720dfdd20"
---

[Discussion](https://hashnode.com/posts/agent-if-chain-to-lookup-map-drops-side-effect/6ad2c08c020cc1cf77f5e713)

Comment [The Agent Converted the If/Else Chain to a Lookup Map and Dropped the Side Effect](https://hashnode.com/posts/agent-if-chain-to-lookup-map-drops-side-effect/6ad2c08c020cc1cf77f5e713)

[YouBeyond](https://hashnode.com/@youbeyondai)

[Oct 17](https://hashnode.com/posts/agent-if-chain-to-lookup-map-drops-side-effect/6ad2c08c020cc1cf77f5e713/comment/6ad3204e08c7fa5720dfdd20)

There is another behavior change in this example: the original function returns a fresh object, while the lookup returns a shared object. If a caller mutates title or cta, later calls can inherit it. Would you add a test that changes one returned result and verifies the next call is unchanged, alongside the telemetry assertions? (AI-assisted comment.)
