Dashboard › opencode › Distillation
c9abfec1-5db1-49fd-83c2-097e0c60cedb["lore_tm_v1_OyDMnSkk_q8kAY9INTWRlIzL0b04gd1ppt20M8NQkPk","lore_tm_v1_bZCmmn4zG-KlomD2ApDa59MftSTPRzQaFbQaIjuoA4k","lore_tm_v1_k_AA0rPW_PsdTXLVmVxe8cYjV66dflQfsVHPnrW4bPo","lore_tm_v1_0oIsDtEg1AfEaRHtsr5Ke4X5LYk0e0-vsc1brIzuND8","lore_tm_v1_5VgcLr-EkYgzPJ7YA-wda2K7t3gtny76eX14vrx9tlU","lore_tm_v1_l75amSYPixRllJBqRjZTiBSdpzCGrkq3UYtlpb3fie8","lore_tm_v1_JIZQh-90GTNRVl5v-7IUy_n5ydoj1Bj5T9kzRUfBhfw","lore_tm_v1_Z2UUMK6j-UhnCP_HSWltRlNFs1ZNcgrMbJp2bVVT3GA","lore_tm_v1_dNhQdTqfw_IbJKFOHfiJX0qxmSoSScMvPtv7GvVHrDE","lore_tm_v1_ZmkVPMbUEG_is4PwjNNpBATEf39UjSWr35MB58v0LWA","lore_tm_v1_vti5g7p5iaiMbvBwPr8NI85Ssz1EYR82HXsRSFeWtKM","lore_tm_v1_FduLJp6vT4U91MTkTjcHDU53fRm2UWTC4bXHZAQV2Gg","lore_tm_v1_giUPniWZyeeZNR--P3kYIZESkIUUmf7dEG2NOBWnYHE","lore_tm_v1_5UQUZnS75sx7DZqVWX7kar0vzm4n2eaWzK6jdcO6qWA","lore_tm_v1_SPxdWKB_4a8cHlYxbdjZiiNv2lS4LrsI9YwyoU_MOTY","lore_tm_v1_FF8v-ASy8aw0Sc0xLbrgHgqI4J69nLUIlzjQG97tvc0","lore_tm_v1_FUtd221GyL-bXyA7Vx-MhOJRI0RFd0DzJ1YabrQymo0","lore_tm_v1_Vazy662k3_-VEgeOMNOqhQRg9f66WRS21pjN0ZVtZYk","lore_tm_v1_yb-q0LolxqxZMxVN5SICnFdaWpADwvRj-NZ9IK57rZo","lore_tm_v1_0PfEmg_aeWt9bR_tE1MMF_3Bm7udQm6wIOU-BMveaXc","lore_tm_v1_aEIDCi3AMkNhDJPUELu7nY3AmKX23BvQ9UUedDTIxTE","lore_tm_v1_9c10pa7Lq1bpCOnkfVE9pyfsxl8ChH9XQWcG8Dfqlwc","lore_tm_v1_eUTkTJwCa4FORFWjFh1cFTNv9Zlo0CmUxDrq8lGGPII","lore_tm_v1_jKUskjb9AQUUWSQucipzC-B042qHwSSvieB9W0RF24Y","lore_tm_v1_Qh3cCCDrMhgOqSVW84rjTOIwjRkOgjMJcLSVEFVUEDA","lore_tm_v1_ca3PVnSRbBeRpl6FVURfP-2tIt_VXy2t3T6__TA6Bho","lore_tm_v1_f3YzJV1NtBFDCDVYRculxY33V3zw-EK7EsPZ2rK0Ftk","lore_tm_v1_Je3dQ-sAH0wRqcFTMo5WhBUp_ClLx2moyB4mUJ6Oahk","lore_tm_v1_acMVE-EhTRqFzFlr7Xy-s61wY0hCROnOhcnukSvnSvE","lore_tm_v1_wbKFWkPdBWlL-N8_GMR5HzGOfBdNU4N9PMW7VMUDaV8","lore_tm_v1_FqORMKc9M-Vi0ceQTk5P9UgAqMcrlepZZuhSCLu9OeU","lore_tm_v1_KS2JOEq2IKTP1FaMV3K4rXzbeChbfcYaWc9aWS0uKSo","lore_tm_v1_RNJyvU1ByHlATmzToudy0o8vozAgGmQfxrnmn8GAiAw","lore_tm_v1_OZ-JFk4A3r92ibmBL7JaK2mqtSo5dqA_RMObWIs_f9c","lore_tm_v1_3MvLPzaFvwkTYytKgM_6UGyNI3dVPU-RaecS7rGK41Y","lore_tm_v1_8uQOwjqGp7nVa-66MQyu3I1eBeWGrC6sqEdRokiGCQE","lore_tm_v1_s8rw8TlDo-uMWtfJkzcwXHNJx9O905h0Rq3Kh76o4qo","lore_tm_v1_y4oZ7HDVg8kw-ZrRNak4NYwp2Jc-hg0KyAnvRENxVNA","lore_tm_v1_bGLx1vufVHdH-gPVp-qLkjgc2s4TGJ5WWPgeTQGgK38","lore_tm_v1__7_F58CnSHsD1w7aDp23fIuZtEt0efx3RpzJ_BxJuK0","lore_tm_v1_ogCPTO6cUCAPymQtF5rMF3GebqTm4HbLsQ9mtXU8Phk","lore_tm_v1_6vK97o6UYp0zEI50WACtykhtG1atWfrO_kieFtwLmz8","lore_tm_v1_s4_zUAZjWXbhPlPR4HFypw9vQlkgNbw9llYeAOrovlM","lore_tm_v1_LxkPDFOrXwuEMaIZ30Jg3PCoPNeNVPaLbhjNQlXt2qk","lore_tm_v1_OjjgGVyqL3G3-AEt64cDZQgrv7Q6bnDRsRqw2ZTY_tc","lore_tm_v1_Q61a7xoq18zs_oTgMSmMrxihdfR8LICp6AZFwWQoaNQ","lore_tm_v1_UW89wk95cJiSS7StnwmO-ojtZ_fLWbPYbZN3pvP5iyQ","lore_tm_v1_NH0htBsZZzYm6QEHoR58MnPWRSvPTeitiBSR4NRWkOs","lore_tm_v1_zVH5y_PxfzKgIZIbeZkmWSG0b0Y_YkQ3FBCgN9aklLs","lore_tm_v1_Rgahs9CcJO9PFFvoeayhxWmZG3rmc9ygZWrZpAFj8Mw","lore_tm_v1_sGhaRX2fsOLTSrA332WUYNu-YwuCosV-hZehSuCv7Tc","lore_tm_v1_z75nFqqQphL2FQRE0hoQOieJRk9Ivs66ORllH3PLw4s","lore_tm_v1_XSTPCkjiTyzCejmz3oaWFKQ6EFbu3bTerm5Bbfi6GfQ","lore_tm_v1_5oqopt4UjJi6FRY9WHh0674wdBllh8Mf235ALT23NRc","lore_tm_v1_f4pUag7RJm3RSwh9Lrhu8yG2SlBghcmqd90CukyWW-k","lore_tm_v1_Vtte4yy9Em1CG_u2NAscaH6rm1qIKQgExqFB5Vgrlcg","lore_tm_v1_ZwW_RGOY1KgUnFkjTdjPp9dW2XjpWF4Yw4O3EoKAl8E","lore_tm_v1_BcIQFi0Tcc28ocKxuh8al8U1Q1uJsBmn-q3Opj2dazY","lore_tm_v1_lVEeucrfA2VMRto1z3XPoC3oqobXfS_xAgYWYJd1lpc","lore_tm_v1_goLjibA8bIQugycs1zNxTlDzwGl9OpxYkxBSRDKpFnY","lore_tm_v1_ZamoS9bdiqbqEgdLEGS9mhph4B2ctgcDBh00BWygk4M","lore_tm_v1_xdOx8TgNfmSyPFu8CC3Kx1BJMjwoXSNYF0gCjt6Ldcw","lore_tm_v1_L6JOnwz42VLdplYqEZ3UhF9zBalZ8rO7vp72ciR2hRQ","lore_tm_v1_53pZzDQPIxajIwIk3IYv6LAADY1BmaOmc4anVelV2Wk","lore_tm_v1_laK-ME4t81g-vjHKdKEw-Zoj7k9Q81Jk7Vaz7SEDxD4","lore_tm_v1_FUaLtB3I_MgcpRvy5nw1xtVV-AJ7z1LSclTdVGCWp9A","lore_tm_v1_LrANWenaBNOgiisvASL7v_UM4IuCUheLp1woEGzaDiw","lore_tm_v1_IfI9n2zY79abA9Llj9cx2aTqYhqqrgdfo-YVNx2CoBY","lore_tm_v1_2lYBEB5JBlhdRwDwr32xk2LO_lv44TGt0pJZYQLP3hg","lore_tm_v1_Akam2Iw9l-lUYHnaCMTaSMxgLLen-eqU1ZqlTxysfdA","lore_tm_v1_vbLrYnSxntidK8dq3wK0-SMuhaGBlFAirrABFxp4f-E","lore_tm_v1_fh65F4sWjGPJAWT4LU9UUq0ht38r3_p6vvFtsNX5yYo","lore_tm_v1_stgBQ1NtRn8E08OxzXKQzGCkmPUymI4j4nzpXoU_f-w","lore_tm_v1_rWq9Zg2fs83Fr9VxJ94uAGZKq6kzPXF68DygSWkHdVA","lore_tm_v1_yG4NDqGNy4Fhoah6BYUXEslP34BQoJJWExYwWwKdIoc","lore_tm_v1_gfCQx1iosMjCsi0OXGyAy_Eze6AmHGkbKSszf0spAWA","lore_tm_v1_JxVA1sJtVmkywGOssSamOSBe0stiLuIGFd0Lptq4FXs","lore_tm_v1_gcePfBrIuQEyVdOi1AmZtHFt1QcDdQD-s5A6CxMKDHY","lore_tm_v1__ryD-P7g09zvPNrk4YvLFtz9aHLfR8IE_Q4smyoyRqo","lore_tm_v1_NGpV8qNm-IFO7KQXHaIDxp16_aESiwyIGbFyeEZdwgw","lore_tm_v1_U1eElGEF6vmktEEC1rN8X1lG-k9iM5QAK1_Vu52GTCQ","lore_tm_v1_e3h42WAzoQq4lWKPrhY71bd-0jvSfuMgMdsZhDaHoYc","lore_tm_v1_cfVrQEw0ohw8kxkWFKr3jN0XCMmrEeBqzKylwXl0x2c","lore_tm_v1_mtdT82JlKvnFY7weTWwWFpOK3qEf5rpgpbGIaEN527M","lore_tm_v1_FEgES25LGhdZbLddEwhojKjTpEvKf9-gazhGcN7QkQI","lore_tm_v1_Br1MEoe1XK7SQlR7mEqXnRzrCIcJOqUKFBrnd5HcqcA","lore_tm_v1_RyQSVtYnPNSqZAKxE1hbuTo_QoWUrPGbOj3epg5MkdU","lore_tm_v1_0IqRSsHdcK9-pobNDFOZC_PNz3cN4Z5yyCNzd7Rio2g","lore_tm_v1_kTEhKx53QOEuMjM4QtDldkJABaSuNQVBFeq8chdCnS0","lore_tm_v1_vwwdUtPCt7HUFHKJJhCNySDc3E_Wh0hqifkf07L_yp4","lore_tm_v1_qxvmx4gJpFnY9gCyVRlWbHNiLm_R3ybA2TL2JJb5_mk","lore_tm_v1_i4Z8GXHin6zYK5_CSLPNYHcleTVPpJ1kapF3Q6At-jg","lore_tm_v1_0DXq86tax8gAWzwb7n7SBznerj02yF0c3YafXEOyngI","lore_tm_v1_AkIWJyGTa6CvCuYHgNDM2OcGrbOu3yTQIb3BPebFFlc","lore_tm_v1_gwwBjFpW6QUiRiSmDh2HCRsC7blpOnI2ZhB6JF3rwLY","lore_tm_v1_-EMc8C82SoQJZ8muKS0vrpddU5T-i5Odwne456d-UhA","lore_tm_v1_-juwXBq84trS7J8JIZG3W5CZ-GKxx9vwWA4Mwt4Y4pQ","lore_tm_v1_BrAFepWeU6B0JBghV4SajaqE3PaCW5PRyig08Tn2c_0","lore_tm_v1_fL5yonGygZ2XubI7v-SslVBIr-iRj4wo5ibImWFqs-E","lore_tm_v1_m_AsYCg29ChCIvVQ4-U48Iwf1dHurq6XUlIU84OPMAU","lore_tm_v1_pOvncro0x-nVzpJrv0HU6Nukt66oJAZq9jDR3HmQy_8","lore_tm_v1_zep2IYUmz_r1SLNMF1s0QvpMwZ7LUSN8oE3QS6cBsEo","lore_tm_v1_yDKjmFfWKyeZ11mE4fRbYPxk02fVi3p9r86ZvfOPyKM","lore_tm_v1_rOx1rqHRFCfMTCLIA59taUwiD3gqztMwTZawEGc-0Co","lore_tm_v1_NclJ7SnLwqQFPaEbS1E7hlulhUjx1AnDuxE77nHCSiY","lore_tm_v1_4Hm64mtFiSWbQrYcSB89VDfCgJkfia_xvuQKyVL_B-E","lore_tm_v1_Ae5xWspvuOhhX_6q4vcJvJjua35fXsLZeqtysJwGteE","lore_tm_v1_U3ByotAgIBfzZu9ieNcuVppbMKRDx9txIN95xYPcH4Y","lore_tm_v1_-wn18fhQK1ziZFQSpdTv7VsEe6jdnrEJmcyTj1mC8VA","lore_tm_v1_LTTz93PVBOQ37ElsEPUH2jliF-V_C_wHV_48XlGoT8Q","lore_tm_v1__eoScunVhDp_LMJoArI_NlW2RNGuMRVNM-mgL-F8bDo","lore_tm_v1_kIs3TPWqeXVsCS6ITRe7h0xaEneW5Rx5oFgwmt00IME","lore_tm_v1_znW_VY1biRTcFDDKSjFN2mZDMIt7nii-IWo-iNRjfk0","lore_tm_v1_umph1rmsK82LbnYWpFrL1zh-VRi0uqJoz9UmlSachPs","lore_tm_v1_IjFqHS9BNXXtAsWDrbJxWoZuyFg5ICnbw0pNDCsgSOE","lore_tm_v1_7mtMcBb96Uvc9Wxl2FJBH4a128UwIoWzUaVdBNjABNA","lore_tm_v1_tbuhRXw9Uhxp0rFIvGuOucgKCCmKqBtOTqAWctnjKUc","lore_tm_v1_NCNgSFCQXqvfMPyHmmPAkq2NSO2AHkgtrHtbfL9dhtM","lore_tm_v1_LgEPbF1EHfeVClYxJUJDn9b4qf-d7Mrt4kl05Yr4U-I","lore_tm_v1_V02cfgwBiQ6zRH2bVCUzXnAcNQ-nRwPwINGIfn6LrNM","lore_tm_v1__DahdKKntYTB5cw8tuw3iAdpHGPpPxAwb9AqgbKs9XM","lore_tm_v1_0SZfOu1fDi9hPCYLjoY2bqeB_0k1P8hceayeTykzOhI","lore_tm_v1_oI91a1n9uZPGV7KCntcysYdmezcw5V-Ya3XqpwgLsY8","lore_tm_v1_6m98gLoG9jOjluNdafuKdaX9wAO3OimCS9qgwMKEQAw","lore_tm_v1_H9N4_DTigjakj7U7h-YF9xsUDghbERzVVKp4x5lskwA","lore_tm_v1_AAawQaVHJEIAJnmiY5jsiy1PlHvQJg1YNBydB98i8Gs","lore_tm_v1_ciMrhGQqg5YkvJ0urhyhSqeUDounjnc8I5FAjfN7VP8","lore_tm_v1_Hwz8ArKkx4Cl9TTY-cUtZ7Fkc1YJWJb53K_TY9IPAuM","lore_tm_v1_XxrYD51WL7ua0pdzt22WYv03YerCBwF1tKP78dXhaXc","lore_tm_v1_J2oAhcp41mgCCzXG7G8GBWSF-0eMofCjYQqsxTIG-a4","lore_tm_v1_xq6_9qW7ZmbBjNlQO-yC-yLJdHy9UDr3x1FXlcTe59g","lore_tm_v1_nHtPK8SN_xvlMSnT85IhPL0aNQR4vkHUKjS9LwbFv3E","lore_tm_v1_gKsTcTEr4X24YVPKYakztjFpn2o_lSgUFq6LbmtZD78","lore_tm_v1_ftifoDPoPNYRMKkJ3zj1T7_rzJlSTGmdmCjMaEaFCvc","lore_tm_v1_aNHBlWNfkhLBZrg7xVCxEW4J51p1WfLvx3ORm50Qi-o","lore_tm_v1_hLXPuSOvTJhSSHlljNAzxCWYopKI1AKUiWS0WS7qFUE","lore_tm_v1_k67v8jZhMCKsCAd9MVs8LcqANEmcGzXNJfyOpEM6t84","lore_tm_v1_f-45-ciljZgSTOQ5tPXW4E_PhF2_jYrZm81qQV_BXpc","lore_tm_v1_gdbAR5W2l5QGGS_aAxqQLEQywa6EiSNGId6ytfAVlEc","lore_tm_v1_Suh81e4LgqoW2GPX09SCuZxhg8vw0U-3TSCvxMGcSWI","lore_tm_v1_3EA7CMXZniuGnzZ7BRjcMQJYKp6y_esQwKg0qAWeZGM","lore_tm_v1_5Lf4s5Spki_4iBjtOClyc9kUjaH-Vvl-1DfEoWytPrc","lore_tm_v1_RYmbdkG385lZbfDEqfNKH1lIm-5Q_VnFAIWT-5g0-MU","lore_tm_v1_hqC-jp4wMbWLzbIbW5k7Xlap1aYxgLzP_YEQW30O50o","lore_tm_v1__D_cVrNv9V5rN9N63znS7uBaW6s-UcQOeXKrg0I8NkI","lore_tm_v1_rE64ybs7th3Ip1yUMGGm3suzeTYKHukTCYYwtRNbYaY","lore_tm_v1_n0oYZmCwIFZpsOgwMQM7ZiAZKxKNkMl1jd83Ktbw3SU","lore_tm_v1_QqKJeiSF9WsHu9hnagdrOOoLPUiekLFAItxf7OAkcOI","lore_tm_v1_OcgHub10i_CAvgwKY4U9edQ9n4hH_724AMWggbn3VbM","lore_tm_v1_9eZ240uJr8vJSZ7EFUfB4Rsx-F3U9MfUuwv0xkZUkC4","lore_tm_v1_XfVb1AeYYOI0KGPGeRq1elcoxb65fyPdNPkjQxG8qIs","lore_tm_v1_DaVtD2SmQ_adSXRsFABGEyndR-QppI5RYNCmyo93gRo","lore_tm_v1_mlpd0e9nRcoVbLW064VAeOidV38z2yvmqeBkR7MoYLc","lore_tm_v1_n_Hmxp-jlvDsk7T9RVZTZE-BOJujcIVzCWRG4DWE-iM","lore_tm_v1_JsacpQpCzdoRtCZd_Npjs6MqIQbkPIaIK_PESB1SPcU","lore_tm_v1_mbaG5pU08I4uiyDRXqSnnpOKNrHje6bWLFt7CJFTKBg","lore_tm_v1_baMtyZwKB2MffJC3sNPe5k0_nLUsvmcBUHrBrPLtsrM","lore_tm_v1_rMWp6j8FtFNHzHKCCCa37qk43gr15l_ZYsYEySFXTfI","lore_tm_v1_oeBb86pN7o-euvWjXO3L6RxQnMT5uc71qojCSq_98aE","lore_tm_v1_FHNuzvomopwHxc8KC_ZhU92sjFo-1X42WeAznre4StI","lore_tm_v1__pxXEVOY8OiO9tNWJ7K9THFSO1sZLO6P82ittwxhAdc","lore_tm_v1_ulWT3FPgosDd4duQYXRJCc5n7LHWlSLVmy6FPibLhow","lore_tm_v1_BME2mH3ueX-wrD0oU76vJ37aJ8xaMIeE-leUF88yz58","lore_tm_v1_srBJ2M3esX9WvwfYF4zc9r38a2AQKhhp9YbYsIZgyEU"]
/home/byk/Code/opencode-v2-pilot; no files may be edited. The goal is to determine the smallest faithful mock/test harness that /home/byk/Code/opencode-lore can retain for a V2 Plugin.define adapter.Location scopes.agents, not legacy agent) and hidden worker behavior./home/byk/Code/opencode-lore branch feat/nightly-release-channel; current intended changes are unrelated to nightly, so a new branch is mandatory. Modified AGENTS.md content, likely produced by Lore distillation, should be included.resolveOrg({ cwd }) first. Required tests include:
permalink.404 behavior and unmodified propagation of 500.resolveOrg() call in numeric-404 tests.CLI_VERSION./home/byk/Code/opencode-v2-pilot is read-only for this task.sdk intentionally composes Client, Core, and Server (AGENTS.md:2).opencode-v2-pilot:
do-not-run-tests-from-root guard (AGENTS.md:167-172).bun typecheck from the relevant package; never invoke tsc directly (AGENTS.md:173-175).globalThis.* unless unavoidable, and test the real implementation rather than duplicating it (AGENTS.md:167-170).import("..."), or use star imports (AGENTS.md:84-89).AGENTS.md:90).HttpApi changes require bun run generate from packages/client; generated files must not be edited.v2; local main may not exist.type(scope): summary; types are feat, fix, docs, chore, refactor, test./home/byk/Code/opencode-lore uses Node.js >=22.5, TypeScript, pnpm workspaces, SQLite WAL mode, and FTS5. Production DB: ~/.local/share/lore/lore.db.@loreai/core → packages/core/@loreai/gateway → packages/gateway/@loreai/opencode → packages/opencode/@loreai/pi → packages/pi/packages/core/test/setup.ts, never production.quality/REVIEW.md, including regression-test discipline, adversarial-order setup, fan-out registry coverage, recurring bug-class batteries, and the two-reviewer rule.CHANGELOG.md; trigger gh workflow run release.yml -f version=auto or an explicit version.packages/plugin/src/promise/adapter.ts adapts Promise definitions into the existing Effect-only Core plugin runtime.Plugin.define(plugin) identity behavior.setup(context) accepting sync or async execution and optionally returning sync or async cleanup.Location.packages/core/test/plugin/host.ts; unused methods die with explicit "unused ..." errors, which is a useful minimal-mock pattern.(canonical Location.Ref, application key), not application key alone. Moving a session must reselect an existing instance at the destination location rather than constructing a third instance.agents; singular agent and mode are legacy compatibility inputs.mode: "subagent" and hidden: true. OpenCode defaults mode to "all" and only honors hidden for subagent-mode agents, otherwise workers leak into the primary Tab picker and @ subagent/skill picker.lore-distill — "Lore memory distillation worker"lore-curator — "Lore knowledge curator worker"lore-query-expand — "Lore query expansion worker"{ auto: false, prune: false } because the gateway handles compaction.packages/opencode/src/internal.ts; packages/opencode/src/index.ts must export only LorePlugin and the same-reference default.applyLoreProviderConfig caused its undefined return to enter the hook array and crash with:
undefined is not an object (evaluating 'A.event')log.silenceStderr() suppresses terminal output while preserving file and Sentry logs.LORE_REMOTE_URL.LORE_GATEWAY_URL.@loreai/gateway port file.3207, then 5673.3207 → 5673 → random.null results are cached because parentID is immutable; failures are not cached and retry later.Symbol.for("lore.fetchInterceptor.originalFetch") guard was chosen over a module-local guard. Multiple bundled copies of Core otherwise capture each other’s interceptor and create gateway → interceptor → gateway → …; the global slot fixes issue #1027 and makes gateway Core inlining safe.applyLoreProviderConfig() remains the universal config lever for provider base URLs where needed. It deep-preserves existing config, pins providers to ${gatewayBase}/v1, sets headerTimeout: false for openai and openai-codex, and creates missing openai config. This prevents Anthropic /messages versus /v1/messages 404s and covers providers without usable base-URL environment variables.packages/plugin/src/promise/plugin.ts:
Context (:25-52) exposes readonly app, location, options, and domains agent, aisdk, catalog, command, event, integration, mcp, generate, permission, reference, rpc, session, shell, skill, storage, tool, vcs, websearch, and worktree.experimental.terminal is Pick<OpenCodeClient["experimental"]["persistentPty"], "read">.plugin is Pick<PluginApi, "list">.Cleanup (::54) is exactly () => Promise<void> | void.Plugin (:56-59) has readonly id: string and setup(context): Promise<Cleanup | void> | Cleanup | void.define(plugin) (:61-63) returns the same object unchanged.packages/plugin/src/promise/registration.ts:
Registration.dispose(): Promise<void>.Hooks<Spec> callbacks return Promise<void> | void.ModelHooks<Spec> permits { providerID?: string } only when the event input has readonly model.Transform<Input> is (callback: (input: Input) => void) => Promise<Registration>.packages/plugin/src/promise/session.ts:
SessionRequestKind = "primary" | "compaction" | "title" | "generate".SessionHooks: prompt, context, "model.request", "http.request", "http.response", retry.SessionPrompt: readonly session/message IDs; mutable prompt, metadata, and delivery.SessionContext: readonly session/agent/model; mutable system, messages, tools, generation, and provider options.Request/Response.{ retry: false } | { retry: true; delay: number }.SessionDomain was reported as exactly 14 methods but the recorded ordered list contains 13: create, get, switchAgent, switchModel, prompt, generate, command, synthetic, interrupt, rename, move, wait, context, plus hook.packages/plugin/src/promise/agent.ts:
list, get, default, update, remove.AgentApi with transform and reload.packages/plugin/src/promise/catalog.ts:
list, get, update, remove.get, update, remove; default get/set.CatalogApi with transform and reload.packages/plugin/src/promise/index.ts exports PluginOptions, 3 storage types, namespace Plugin, and schema namespaces in exact order:
AgentCommandConnectionCredentialIntegrationLocationMcpModelPersistentPtyProviderReferenceRpcSkillVcsWebSearchWorktreepackages/plugin/src/promise/adapter.ts is 639 lines and implements fromPromise(plugin).makeStreams() (:48-78):
Scope.Set.AbortSignal, including already-aborted signals.return: close.rpcFromEffect() (:80-164):
Effect.runPromiseWith(context).options?.signal.subscribe and on.on combines cancellation through AbortSignal.any, logs asynchronous loop/handler failures with Effect.logError, and returns an aborting disposer.Reflect.apply(handler, undefined, [input, { signal, error }]).ReturnedRpcError values map to the host RPC typed error; unrelated values pass through.compileEndpoint() (:171-207):
WeakMap<object, CompiledEndpoint>.Unsupported API schema cardinality: ${endpoint.identifier}.HttpApiSchema.NoContent.data property where appropriate.adaptApiMethod() decodes input, merges decoded objects via Object.assign({}, ...decoded), invokes the host endpoint, returns undefined for no-content, and encodes other outputs.fromPromise() dynamically imports Protocol endpoint contracts, captures Effect scope/fiber context, assembles the Promise context, and executes plugin.setup(context2) through Effect.acquireRelease.Effect.promise(() => Promise.resolve(cleanup())).Promise.resolve; transform registration uses the captured scope/context.executePromiseTool():
Effect.runPromise(context.progress(update)).TypedFailure to Tool.Error; message priority is string feedback, then Error.message, then String(error).Effect.die.AbortSignal.packages/core/test/plugin/worktree.test.ts confirms Promise worktree cancellation: interruption changes signal.aborted from false to true; the promise rejects with Error("cancelled"); the Effect result contains interrupts only.packages/core/src/plugin/hooks.ts:
aisdk, session, permission, shell, tool.tool.execute.before may fail with Tool.Error; all other hook error channels are never.Scope, return idempotent { dispose }, and delete empty map entries.event.model.providerID; unscoped hooks match all providers.trigger() runs matching callbacks sequentially and returns the mutated event.packages/core/src/plugin.ts:
Slot per requested definition, including failed setup slots.Duplicate plugin ID: ${definition.id}.(id, revision) prefix and tears down changed healthy suffix activations in reverse order."failed to restore plugin; deactivating".Plugin disabled after ${failure.state}.transform failed. Check server logs for details.err_${first 8 UUID characters}.Activation, preventing stale queued failures from disabling replacements.Effect.ensuring.closed, clears pending holds, opens readiness, clears slots, and performs State.shutdown(Scope.close(scope, exit)).packages/core/src/plugin/supervisor.ts documents failed revision semantics: “The new revision never became a generation, so the one already running keeps its place.”packages/core/test/plugin.test.ts:120, "unloading a plugin removes its commands and runs cleanup".packages/core/test/plugin.test.ts:401, "does not let asynchronous plugin cleanup block recovered registry readiness"; plugin "async-cleanup" at :408.ctx.command.transform adds late then throws late Promise failure; plugin becomes failed, late is absent, later registrations are ignored.packages/core/test/plugin-failure.test.ts: failed plugin loses command, shell hook, and RPC handler while healthy plugin remains active; cleanup completes within "1 second"."250 millis" even when old cleanup is queued."observer failed" does not prevent failure handling or cleanup.packages/sdk/test/instances-lifecycle.test.ts: cancelled borrower does not strand failed construction; first acquisition releases after failure, second succeeds, host close releases second.packages/sdk/test/promise.test.ts calls close() twice.{ name: "ClientError", reason: "Transport" }.packages/sdk/src/promise.ts:
InstanceConfiguration.plugins is ReadonlyArray<Plugin.Plugin>.InstanceOptions.key(encodedSession) chooses an application key within the session’s current Location and must not initialize plugins.configure(key) reconstructs on cache misses, including host restart.PluginPromise.fromPromise.packages/core/src/location-service-map.ts canonicalizes Location.Ref before resource-cache keying; Windows uses path.normalize, and workspaceID is preserved.packages/sdk/test/instances.test.ts:16: lazy instances share by key and Location and remain isolated across hosts.:146: failed instance admits nothing, preserves healthy instances, and retries.:223: persisted Session callbacks reconstruct only on cold prompt.:297: plugin ID collision rejects admission and reconstructs on retry.packages/sdk/test/instances-effect.test.ts:
configured = ["thread-recovery", "thread-recovery"], closed = [1, 2], executed = [2], title "thread-recovery:2", and exactly 3 LLM requests with temperature 0.25 and tool thread_echo."same-thread" configure twice, once per workspace."Persona store cold" and finalizes attempts "thread-7:1" then "thread-7:2".packages/sdk/test/instances-lifecycle.test.ts:
Error("Configuration unavailable").released = [1]; later success yields acquired = [1, 2]; host close yields released = [1, 2].packages/server/test/session-instances.test.ts builds per-session instances with LayerMap.make, idleTimeToLive: Duration.infinity, Instance.layer(..., { discovery: false, ... }), and a "session-instance" plugin that scopes prompts, generation, permissions, tools, and commands by exact Session ID.packages/core/src/session/model-request.ts triggers:
"model.request" at line 224."http.request" at line 249."http.response" at line 261.HookScope (:199-205) contains session ID, agent, model, and SessionRequestKind.applyModelHooks():
HttpOptions while preserving body/query.httpMiddleware():
Request/Response.Uint8Array with content type before conversion back.HttpClientResponse.Error causes to new Error(String(cause)).input.webSocket === "session", and no matching HTTP hooks.SessionModelRequest.prepare():
contextAgentID ?? agentID; model/HTTP hooks retain original agentID.contextHooks === false.session.fork?.sessionID ?? session.id for cache key.Provider context is incompatible with the route selected by model request hooks for incompatible native compaction provenance.sessionHeaders() emits "x-session-affinity", "X-Session-Id", optional "x-parent-session-id", "User-Agent", "x-opencode-project", "x-opencode-session", and "x-opencode-client".promptCacheKey() strips ses_ only for /^ses_[0-9a-f]{64}$/.packages/core/test/session-model-request-hooks.test.ts:
KINDS = ["primary", "compaction", "title", "generate"]."tags every Session request kind on http.request and http.response" expects alternating request/response records for all 4 kinds and agent build.ses_hook_kind, global project, location /project, epoch timestamps, zero costs/tokens.test/gpt-5.5, context limit 200_000, output 32_000.packages/core/test/session-native-compaction.test.ts confirms both model and HTTP hooks receive "compaction".packages/core/test/session-owned.test.ts confirms interrupted prompt preparation admits no inbox item, preserves staged revert/context, creates no wakes, and does not acquire extra locations.session.prompt, not synthetic/shell/compaction/move controls.kind, not agent ID, distinguishes primary, compaction, title, and generate requests.packages/core/test/session-model-request.test.ts tests unsupportedParts and boundImages.logo.png → ERROR: Cannot read "logo.png" (this model does not support image input). Inform the user.document.pdf → corresponding PDF error.9 * 1024 * 1024 characters replace first and second, retain third.13 * 1024 * 1024 characters replace first, retain second.packages/plugin/src/host.ts resolution order:
["server", ""]["tui"]["rpc"]ENOENT, ENOTDIR, MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_PATH_NOT_EXPORTED, and ERR_UNSUPPORTED_DIR_IMPORT.packages/plugin/test/host.test.ts is 156 lines. Every fixture entrypoint throws Plugin code must not run during resolution.index.ts, tui.tsx, rpc.ts without package.json.main, plus TUI/RPC../server preferred over root, with ./tui and ./rpc.import .mjs over require .cjs.undefined.packages/core/src/plugin/module.ts:
Host.resolve.npm.resolve; install mode uses npm.add.{ pending: true }.Plugin entrypoint not found: ${operation.target}.id and either effect or setup; otherwise:
Plugin must export a default definition with an id and an effect or setup function.PluginPromise.fromPromise.@opencode/plugin package:
1.18.15, ESM, MIT.bun test --only-failures, tsgo --noEmit, tsc -p tsconfig.build.json.".", "./effect", "./host", "./tui", "./*".finally.packages/sdk/test/import-boundaries.test.ts bundles both @opencode/sdk and @opencode/sdk/effect, requiring inputs from Client, Core, and Server.packages/sdk/test/contract-identity.test.ts:
Api and ClientApi with { groupNames, omitEndpoints: promiseOmitEndpoints } and expects identical Promise output.packages/schema/src/config.ts defines native agents as a record of ConfigAgent.Info; default_agent selects the default primary agent.packages/schema/src/config/agent.ts fields: model, request, system, description, mode, hidden, color, steps, disabled, permissions. Modes are "subagent" | "primary" | "all"; color matches /^#[0-9a-fA-F]{6}$/; steps is positive integer.packages/schema/src/agent.ts runtime Agent.Info requires id/name/request/mode/hidden/permissions. Defaults:
"primary", hidden false.*.env; ask read *.env.*; allow read *.env.example.packages/core/src/config/plugin/agent.ts:
agent, agents, mode, modes.{agent,agents}/**/*.md as non-primary and {mode,modes}/*.md as primary.ConfigAgentV1; native uses ConfigAgent.Info.mode: "primary".PubSub.sliding<void>(1) and "100 millis" debounce.packages/core/test/config/normalization.test.ts:
agent, legacy mode, native agents.["agents", "reviewer"].small_model migrates to agents.title.model; malformed values are omitted without leaking supplied values.packages/core/src/config/normalize.ts::normalizeCompaction():
tail_turns and prune unsupported.preserve_recent_tokens and native keep.tokens to keep.tokens.reserved and native buffer to buffer.packages/core/src/agent.ts:
"build".mode === "subagent" and hidden === true.list() moves selected default first; select() falls back to build.packages/core/test/config/agent.test.ts confirms global permissions precede agent-specific permissions and disabled agents are removed.packages/opencode/package.json:
@loreai/opencode 0.40.0, ESM, FSL-1.1-Apache-2.0../src/index.ts.typecheck: "tsc --noEmit".@opencode-ai/plugin >=1.1.0; dependencies @loreai/core, @loreai/gateway.packages/opencode/tsconfig.json extends root base, sets noEmit, Bun types, maps @loreai/core, and includes src, test, script, scripts, eval.index.test.tsrouting.e2e.test.tsinternal.test.tsgateway-smoke.test.tssubagent-detection.test.tstui-silence.test.tssession-state.test.tspackages/opencode/test/index.test.ts verifies:
LorePlugin and same-reference default are exported."my-agent" is preserved.processInitDone, processLoreActive, processLoreBase, memoized loreInitPromise.ctx.project.id.SESSION_STATE_TTL_MS = 24 * 60 * 60 * 1000.chat.headers adds gateway access, x-lore-session-id, x-lore-agent, optional parent/project/git remote, and provider ID. Provider upstream env key is LORE_UPSTREAM_${providerID.toUpperCase().replace(/-/g, "_")}.x-lore-*, x-api-key, x-goog-api-key, and authorization are rejected.NODE_ENV === "test" or argv containing .test.; LORE_OPENCODE_FORCE_ACTIVE=1 overrides.packages/core/src/fetch-interceptor.ts exports installFetchInterceptor./messages, /completions, or /responses.localhost, 127.0.0.1, 0.0.0.0, ::1, [::1].buildGatewayHeaders() handles URL and Request forms, preserves original headers, sets x-lore-upstream-url, and conditionally x-lore-upstream-path.getHeaders() values.fetch-interceptor: getHeaders() failed:fetch-interceptor: onRequestHeaders() failed:Object.assign(interceptor, originalFetch) to preserve properties such as preconnect.ResolutionError, use setAuthToken("test-token"), setOrgRegion, DEFAULT_SENTRY_URL, and useTestConfigDir("test-issue-utils-", { isolateProjectRoot: true }).resolveOrg({ cwd }) should return null; resolution should fall back to unscoped getIssue.404 for 123456789 must:
ResolutionError.project>-123456789.500 must propagate unchanged.packages/opencode/eval/data/sessions/cli-sentry-issue.jsonpackages/opencode/eval/data/sessions/cli-nightly.jsonversion.json: {"version":"0.13.0-dev.9999999999","sha":"def456","date":"2026-02-26T02:00:00Z"}updated-linux-binary-v2CLI_VERSION.opencode-v2-pilot, asking for exact evidence and a minimal Lore V2 Plugin.define harness.@opencode/plugin package exports and related boundary tests were catalogued.feat/nightly-release-channel, new-branch requirement, issue permalink/subdomain test requirements, and Lore workflow constraints were recorded.agents schema, migration precedence, runtime agent defaults, config Markdown discovery, permission expansion, publish behavior, and plugin module loading/watching were inspected.