feat(plugins): default Ponytail to ultra mode

- Set defaultMode "ultra" in Ponytail's config file during install and
  update when Ponytail is selected, keeping other keys and leaving
  unreadable files untouched.
- Load ponytail in ultra mode in the plugin workflow and its evals.
- Document the default and the PONYTAIL_DEFAULT_MODE precedence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-16 11:40:02 +01:00
1 parent f7222a90c2
commit b8019dbe9a
4 files changed
+38 -6

No files matched your search

+32
View File
@@ -16,6 +16,9 @@ import urllib.request
import zipfile
PONYTAIL_MODE = 'ultra'
def linked(path):
try:
metadata = path.lstat()
@@ -424,6 +427,33 @@ class Manager:
self.state['resources'].append(dict(client='shared', name=entry['name'], kind='cli', package=package, clients=[client]))
self.save()
def ensure_ponytail_mode(self):
# Same lookup as Ponytail's hooks/ponytail-config.js; PONYTAIL_DEFAULT_MODE still wins over this file.
if os.environ.get('XDG_CONFIG_HOME'):
directory = Path(os.environ['XDG_CONFIG_HOME'])
elif os.name == 'nt':
directory = Path(os.environ.get('APPDATA') or self.home / 'AppData/Roaming')
else:
directory = self.home / '.config'
path = directory / 'ponytail/config.json'
try:
config = json.loads(path.read_text(encoding='utf-8-sig')) if path.is_file() else {}
except ValueError:
config = None
if not isinstance(config, dict):
print(f'WARN Preserving unreadable Ponytail configuration: {path}')
return
if config.get('defaultMode') == PONYTAIL_MODE:
return
if self.dry_run:
if not self.summary:
print(f'DRYRUN set Ponytail default mode to {PONYTAIL_MODE}')
return
if linked(path) or linked(path.parent):
raise ValueError('Ponytail configuration path contains a link.')
config['defaultMode'] = PONYTAIL_MODE
atomic_write(path, (json.dumps(config, indent=2) + '\n').encode('utf-8'))
def ensure_mcporter(self, entry, clients):
server, url = entry['mcporter_name'], entry['mcporter_url']
if not re.fullmatch(r'[a-z0-9-]+', server) or not re.fullmatch(r'https://[^\s]+', url):
@@ -536,6 +566,8 @@ class Manager:
for entry in direct_entries.values():
if client != 'codex' or entry['name'] not in claude_only:
self.ensure(client, entry)
if 'Ponytail' in direct_entries:
self.ensure_ponytail_mode()
for entry in mcporter_entries.values():
self.ensure_mcporter(entry, clients)
print('EXTENSIONS: reconciliation complete' + (' (dry run)' if self.dry_run else ''))