# fix\(opencode\): use last-step input for oversized-session check · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/ba63cde9cd35f4b927d861512200c945803822cf)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: ba63cde9cd35f4b927d861512200c945803822cf

Requested commit: ba63cde9cd35f4b927d861512200c945803822cf

Commit: ba63cde9cd35f4b927d861512200c945803822cf

Tree: b5f5481ffcecb8513416c6f33c7581142346b7da

Author: Imamuzzaki Abu Salam

Committer: Imamuzzaki Abu Salam

## Message

```
fix(opencode): use last-step input for oversized-session check

turn.usage.input accumulates across steps, so several fitting steps
could sum past the window and misclassify a later unrelated
InvalidRequest. Use the last completed step's input (the live context
size, same basis as the reported turn token usage) instead.

```

## Parents

- [073cb011c5a2f3b39f352173108267d6b9771928](https://git.cafe/pingdotgg/t3code/commit/073cb011c5a2f3b39f352173108267d6b9771928?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/ba63cde9cd35f4b927d861512200c945803822cf?format=markdown)
