[FEATURE]: Session logging as OpenAI messages
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
It is benefitial for users to have the ability to preserve individual request-response pairs of a session into json files with timestamp, so that SFT training traces can be later generated with correct sequence of operations and system message + tool call schema which will benefit open source model training.
Overall, the PR attached below will support logging of the messages as individually grouped by session id and timestamp, and provide a utility script to merge these messages into a single final trace that can then be used freely with HF and other libraries to SFT the model.
It also adds an environment flag to disable node module installation if a .opencode dir is found.
I am using opencode to generate data at a large scale, and for storage isolation, each directory has opencode run with a .opencode directory with different args and permissions etc.