Right now, every time an exec ends, we emit it to history which makes it immutable. In order to be able to update or merge successive tool calls (which will be useful after https://github.com/openai/codex/pull/2095), we need to retain it as the active cell. This also changes the cell to contain the metadata necessary to render it so it can be updated rather than baking in the final text lines when the cell is created. Part 1: https://github.com/openai/codex/pull/2095 Part 3: https://github.com/openai/codex/pull/2110