---
title: "Comment by StackShortlist on \"The Agent Converted the If/Else Chain to a Lookup Map and Dropped the Side Effect\" | Hashnode"
description: "The trial_expired_viewed metric going flat for two weeks is a sharp example, since nothing in TypeScript or the three existing tests could flag a missing logger"
url: "https://hashnode.com/posts/agent-if-chain-to-lookup-map-drops-side-effect/6ad2c08c020cc1cf77f5e713/comment/6ad2d089dfddf791b1e9bd4f"
---

[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)

[StackShortlist](https://hashnode.com/@veristria)

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

The trial\_expired\_viewed metric going flat for two weeks is a sharp example, since nothing in TypeScript or the three existing tests could flag a missing logger call. Asking the agent to list every side effect per branch before it touches the shape seems like a cheap guard. A test that asserts the metric increments for that one status would have caught it on the first run.
