The shell.env and experimental.session.compacting hooks dereferenced
output.env and output.prompt unconditionally. When OpenCode invokes a
hook without an output object, this threw TypeError: undefined is not an
object and aborted compaction entirely.
- shell.env: early-return when output is undefined
- experimental.session.compacting: guard the output.prompt/output.context
branches so a missing output no-ops instead of throwing
Add regression tests for both hooks covering the undefined-output case.
Fixes#3934