mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-21 07:31:28 +08:00
fix: context-size /compact trigger, Codex marketplace plugin path, live README badges (#2237)
- suggest-compact hook now reads the latest usage record from the session transcript and suggests /compact at a window-scaled token threshold (160k/200k window, 250k/1M window; COMPACT_CONTEXT_THRESHOLD and COMPACT_CONTEXT_INTERVAL overridable), re-firing per 60k-token growth bucket; tool-call count stays as the secondary signal (#2155) - Codex repo marketplace now points at ./plugins/ecc instead of ./ — Codex never discovers plugins whose local marketplace source.path is the marketplace root (verified on Codex CLI 0.137.0); plugins/ecc is a thin folder referencing root skills/.mcp.json per maintainer direction on #2097; docs flag plugin mode as experimental with the upstream blocker openai/codex#26037 linked (#2128) - README badges for installs/stars/forks now use shields endpoint badges backed by api.ecc.tools (live install count 3,712 vs the stale static 150), which also eliminates shields' 'Unable to select next GitHub token from pool' render in the stars badge Closes #2155 Closes #2128
This commit is contained in:
@@ -393,7 +393,11 @@ test('marketplace.json plugin version matches package.json', () => {
|
||||
assert.strictEqual(marketplace.plugins[0].version, expectedVersion);
|
||||
});
|
||||
|
||||
test('marketplace local plugin path resolves to the repo-root Codex bundle', () => {
|
||||
test('marketplace local plugin path resolves to a concrete plugin subdirectory (#2128)', () => {
|
||||
// Codex does not discover plugins whose local marketplace source.path is the
|
||||
// marketplace root itself ("./") — verified against Codex CLI 0.137.0 and
|
||||
// the official docs ($REPO_ROOT/plugins/<name>). The entry must point at a
|
||||
// real plugin folder strictly inside the repo.
|
||||
for (const plugin of marketplace.plugins) {
|
||||
if (!plugin.source || plugin.source.source !== 'local') {
|
||||
continue;
|
||||
@@ -401,12 +405,67 @@ test('marketplace local plugin path resolves to the repo-root Codex bundle', ()
|
||||
|
||||
assert.ok(plugin.source.path.startsWith('./'), `Codex marketplace source.path must be ./-prefixed: ${plugin.source.path}`);
|
||||
const resolvedRoot = path.resolve(repoRoot, plugin.source.path);
|
||||
assert.strictEqual(resolvedRoot, repoRoot, `Expected local marketplace path to resolve to repo root from marketplace root, got: ${plugin.source.path}`);
|
||||
assert.ok(fs.existsSync(path.join(resolvedRoot, '.codex-plugin', 'plugin.json')), `Codex plugin manifest missing under resolved marketplace root: ${plugin.source.path}`);
|
||||
assert.ok(fs.existsSync(path.join(resolvedRoot, '.mcp.json')), `Root MCP config missing under resolved marketplace root: ${plugin.source.path}`);
|
||||
assert.notStrictEqual(resolvedRoot, repoRoot, `Codex never discovers "./" marketplace roots — source.path must target a plugin subdirectory (#2128), got: ${plugin.source.path}`);
|
||||
assert.ok(resolvedRoot.startsWith(repoRoot + path.sep), `Expected local marketplace path to stay inside the repo, got: ${plugin.source.path}`);
|
||||
assert.ok(fs.existsSync(path.join(resolvedRoot, '.codex-plugin', 'plugin.json')), `Codex plugin manifest missing under resolved plugin folder: ${plugin.source.path}`);
|
||||
}
|
||||
});
|
||||
|
||||
// ── plugins/ecc marketplace plugin folder ─────────────────────────────────────
|
||||
// Thin Codex plugin target for the repo marketplace. Content is single-sourced
|
||||
// at the repo root (no vendored skills/MCP copies) per the maintainer direction
|
||||
// on #2097; these tests pin the manifest sync and the parent-relative refs.
|
||||
console.log('\n=== plugins/ecc Codex marketplace plugin folder ===\n');
|
||||
|
||||
const marketplacePluginManifestPath = path.join(repoRoot, 'plugins', 'ecc', '.codex-plugin', 'plugin.json');
|
||||
const marketplacePluginManifest = loadJsonObject(marketplacePluginManifestPath, 'plugins/ecc/.codex-plugin/plugin.json');
|
||||
const rootCodexManifest = loadJsonObject(path.join(repoRoot, '.codex-plugin', 'plugin.json'), '.codex-plugin/plugin.json');
|
||||
|
||||
test('plugins/ecc manifest name matches the root Codex manifest', () => {
|
||||
assert.strictEqual(marketplacePluginManifest.name, rootCodexManifest.name);
|
||||
});
|
||||
|
||||
test('plugins/ecc manifest version matches package.json', () => {
|
||||
assert.strictEqual(marketplacePluginManifest.version, expectedVersion);
|
||||
});
|
||||
|
||||
test('plugins/ecc manifest version matches the root Codex manifest', () => {
|
||||
assert.strictEqual(marketplacePluginManifest.version, rootCodexManifest.version);
|
||||
});
|
||||
|
||||
test('plugins/ecc manifest reuses root skills and MCP config without vendoring', () => {
|
||||
const pluginDir = path.dirname(path.dirname(marketplacePluginManifestPath));
|
||||
|
||||
const skillsTarget = path.resolve(pluginDir, marketplacePluginManifest.skills);
|
||||
assert.strictEqual(skillsTarget, path.join(repoRoot, 'skills'), `skills ref must resolve to the root skills/ directory, got: ${marketplacePluginManifest.skills}`);
|
||||
assert.ok(fs.existsSync(skillsTarget), 'Root skills/ directory missing');
|
||||
|
||||
const mcpTarget = path.resolve(pluginDir, marketplacePluginManifest.mcpServers);
|
||||
assert.strictEqual(mcpTarget, path.join(repoRoot, '.mcp.json'), `mcpServers ref must resolve to the root .mcp.json, got: ${marketplacePluginManifest.mcpServers}`);
|
||||
assert.ok(fs.existsSync(mcpTarget), 'Root .mcp.json missing');
|
||||
|
||||
assert.ok(!fs.existsSync(path.join(pluginDir, 'skills')), 'plugins/ecc must not vendor a second skills/ copy (see #2097 review)');
|
||||
assert.ok(!fs.existsSync(path.join(pluginDir, '.mcp.json')), 'plugins/ecc must not vendor a second .mcp.json (see #2097 review)');
|
||||
});
|
||||
|
||||
test('plugins/ecc manifest interface assets resolve to root assets', () => {
|
||||
const pluginDir = path.dirname(path.dirname(marketplacePluginManifestPath));
|
||||
|
||||
for (const ref of [marketplacePluginManifest.interface.composerIcon, marketplacePluginManifest.interface.logo]) {
|
||||
const target = path.resolve(pluginDir, ref);
|
||||
assert.ok(target.startsWith(path.join(repoRoot, 'assets') + path.sep), `Asset ref must resolve under root assets/: ${ref}`);
|
||||
assert.ok(fs.existsSync(target), `Asset ref target missing: ${ref}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('plugins/ecc README documents the upstream Codex fragility', () => {
|
||||
const readmePath = path.join(repoRoot, 'plugins', 'ecc', 'README.md');
|
||||
assert.ok(fs.existsSync(readmePath), 'Expected plugins/ecc/README.md');
|
||||
const source = fs.readFileSync(readmePath, 'utf8');
|
||||
assert.ok(source.includes('openai/codex'), 'plugins/ecc README must link the upstream Codex discovery issue');
|
||||
assert.ok(source.includes('sync-ecc-to-codex.sh'), 'plugins/ecc README must point at the supported manual sync flow');
|
||||
});
|
||||
|
||||
test('.opencode/package.json version matches package.json', () => {
|
||||
assert.strictEqual(opencodePackage.version, expectedVersion);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user