Commit f3db564
authored
fix: reduce context duplication from ~22k to ~11k tokens (#383)
* fix: reduce context duplication from ~22k to ~11k tokens
Remove redundant env info and root AGENTS.md injection that OpenCode
already provides, addressing significant token waste on startup.
Changes:
- src/agents/utils.ts: Remove duplicated env fields (working dir,
platform, date) from createEnvContext(), keep only OmO-specific
fields (time, timezone, locale)
- src/hooks/directory-agents-injector/index.ts: Skip root AGENTS.md
injection since OpenCode's system.ts already loads it via custom()
Fixes #379
* refactor: remove unused _directory parameter from createEnvContext()
---------
Co-authored-by: sisyphus-dev-ai <[email protected]>1 parent 15b0ee8 commit f3db564
2 files changed
+19
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | 50 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 51 | + | |
59 | 52 | | |
60 | 53 | | |
61 | 54 | | |
62 | | - | |
| 55 | + | |
63 | 56 | | |
64 | 57 | | |
65 | 58 | | |
| |||
97 | 90 | | |
98 | 91 | | |
99 | 92 | | |
100 | | - | |
| 93 | + | |
101 | 94 | | |
102 | 95 | | |
103 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | | - | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
0 commit comments