bash history is appended, but histappend is off

histappend is the setting I would expect to control this. Since those aren't login shells, it won't be something going on in /etc/bash.bash.logout or ~/.bash_logout. Check to see if a trap is set by entering trap -p. Also do echo $PROMPT_COMMAND to see if something is going on there.


bash tries to append history as much as possible. With histappend on, you will guarantee always appending history. If it is off, history will still be appended only until the number of commands you Enter in a interactive bash session > HISTSIZE. When this happens, history will be overwritten.

If you want to explicitly overwrite history, you can use history -w in .bash_logout or an exit trap.

I posted in more detail in this answer about how bash history append works.