Commit 7744e0a
authored
feat: update opencode patch with ATOF JSONL export (NVIDIA#62)
#### Overview
Refreshes the OpenCode integration patch so NeMo Flow can preserve raw ATOF events as a JSONL sidecar artifact while keeping the existing optional direct ATIF export path.
The raw ATOF JSONL artifact is intentionally preserved as the lossless publisher output. ATIF remains the normalized evaluation artifact, but keeping ATOF lets us validate the harness publisher independently, debug converter issues, and regenerate ATIF/evaluation artifacts offline without rerunning the agent task. This is especially useful while the NeMo-Flow harness integrations and ATOF-to-ATIF mapping are still evolving.
- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.
#### Details
- Adds a raw ATOF JSONL subscriber controlled by `NEMO_FLOW_ATOF_DIR`, writing `events.jsonl`.
- Keeps direct ATIF export optional via `NEMO_FLOW_ATIF_DIR` for comparison/debug output.
- Updates the OpenCode patch so wrapped tools return OpenCode's original JavaScript values while NeMo Flow observes JSON-safe snapshots.
- Avoids duplicate tool execution if native event observation fails after the wrapped callback has already run.
- Ensures batch tool scopes are popped with a `finally` block.
- Documents the artifact paths and validation flow in `third_party/README-opencode.md`.
#### Where should the reviewer start?
Start with `patches/opencode/0001-add-nemo-flow-integration.patch`, especially the `src/nemo_flow/index.ts` additions for the ATOF JSONL subscriber and tool wrapper behavior. Then review `third_party/README-opencode.md` for the documented contract.
Validation run locally:
- `git diff --check`
- `./scripts/apply-patches.sh --check`
- `bun run typecheck` in `third_party/opencode/packages/opencode`
- `uv run pre-commit run --files patches/opencode/0001-add-nemo-flow-integration.patch third_party/README-opencode.md`
#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
- Relates to NAT-6, Harbor / NAT integration smoke testing for OpenCode with NeMo Flow ATOF export
## Summary by CodeRabbit
* **New Features**
* Optional NemoFlow integration for real-time tracing, monitoring, and agent/tool scope management
* Session-based trajectory export (including ATIF JSONL) and NemoFlow-backed exporters
* LLM requests now accept custom HTTP headers (extraHeaders passthrough)
* **Chores**
* Manifest updates to declare NemoFlow as an optional dependency and enable opt-in configuration flag
Authors:
- Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)
Approvers:
- Will Killian (https://github.com/willkill07)
URL: NVIDIA#621 parent 30245c3 commit 7744e0a
2 files changed
Lines changed: 81 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
| 598 | + | |
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
624 | 625 | | |
625 | | - | |
626 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
627 | 632 | | |
628 | 633 | | |
629 | 634 | | |
630 | 635 | | |
631 | 636 | | |
632 | | - | |
| 637 | + | |
633 | 638 | | |
634 | 639 | | |
635 | | - | |
| 640 | + | |
636 | 641 | | |
637 | 642 | | |
| 643 | + | |
638 | 644 | | |
639 | 645 | | |
640 | 646 | | |
| |||
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
647 | 663 | | |
648 | 664 | | |
649 | 665 | | |
| |||
706 | 722 | | |
707 | 723 | | |
708 | 724 | | |
| 725 | + | |
| 726 | + | |
709 | 727 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
718 | 735 | | |
719 | 736 | | |
720 | 737 | | |
721 | 738 | | |
| 739 | + | |
722 | 740 | | |
723 | 741 | | |
724 | 742 | | |
| |||
757 | 775 | | |
758 | 776 | | |
759 | 777 | | |
| 778 | + | |
760 | 779 | | |
761 | 780 | | |
762 | 781 | | |
| |||
803 | 822 | | |
804 | 823 | | |
805 | 824 | | |
| 825 | + | |
806 | 826 | | |
807 | 827 | | |
808 | 828 | | |
| |||
845 | 865 | | |
846 | 866 | | |
847 | 867 | | |
| 868 | + | |
848 | 869 | | |
849 | 870 | | |
850 | 871 | | |
| |||
891 | 912 | | |
892 | 913 | | |
893 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
894 | 932 | | |
895 | 933 | | |
896 | 934 | | |
897 | | - | |
| 935 | + | |
898 | 936 | | |
899 | 937 | | |
900 | | - | |
| 938 | + | |
901 | 939 | | |
902 | 940 | | |
903 | 941 | | |
| |||
913 | 951 | | |
914 | 952 | | |
915 | 953 | | |
916 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
917 | 959 | | |
918 | 960 | | |
919 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| |||
80 | 91 | | |
81 | 92 | | |
82 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments