Skip to content

feat(life/app): app-only prompt slimming + per-agent appSkills scoping - #80

Merged
cryptolir merged 1 commit into
mainfrom
feat/life-app-prompt-optimization
Jun 20, 2026
Merged

cryptolir merged 1 commit into
mainfrom
feat/life-app-prompt-optimization

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

Implements the Phase 1–2 token/latency optimization from #77 (rev4), scoped to app-user sessions only — Telegram/owner prompts stay byte-identical (all changes flow through app-only code paths).

What changed

  • New `"app"` PromptMode (system-prompt.ts): drops CLI quick-ref / self-update / model-aliases / docs / silent-replies / heartbeats / owner-identity (privacy), but keeps Reply-Tags/Messaging/Voice (unlike "minimal"). Telegram/owner stay on "full".
  • App-only bootstrap shaping (resolveBootstrapFilesForRun → applyAppBootstrapVariants): excludes boilerplate (TOOLS/MEMORY/HEARTBEAT/IDENTITY/USER) and prefers lean <name>.app.md variants when present (AGENTS.app.md/SOUL.app.md). Originals never read for swapping → non-app byte-identical.
  • Per-agent `appSkills` allowlist (Codex 4536644504 chore(ci): replace Docker release with GCP staging deploy #1 / 4536672313): new field on both the agent-defaults and agent-entry types+schemas; resolveAppSkillsAllowlist(cfg, agentId) = entry.appSkills ?? agents.defaults.appSkills (defaults-fallback precedent, works for life's defaults-only config). limitAppSkills takes the caller-resolved allowlist → never global.
  • Shared `resolveAppPromptContext` helper (Codex 4536644504 chore: add multi-agent coordination files #2): consumed by both attempt.ts and compact.ts so the run + compaction paths can't drift; agent id resolved up front, before skill filtering.

Deferred (to the caching increment)

APP_PROFILE dedicated render-slot + per-session bootstrap memoization — pure cache-prefix-stability work with no token/latency payoff until Venice caching lands (Phase 3). APP_PROFILE stays exactly where it is, so the #71 first-turn greeting is untouched.

Verification

  • tsgo + oxlint clean. New tests (22): app PromptMode drop/keep + full byte-identical control; resolveAppSkillsAllowlist defaults-only + per-agent isolation; applyAppBootstrapVariants exclude/swap; limitAppSkills allowlist.
  • appSkills allowlist ships as a dormant mechanism — not set on life this roll (unset = today's behavior), so no skill-access risk.

🤖 Generated with Claude Code

… scoping

Reduce per-turn latency + tokens for Havaya app-user sessions while keeping
Telegram/owner prompts byte-identical (all changes flow through app-only code paths):

- New "app" PromptMode: drops CLI quick-ref / self-update / model-aliases / docs /
  silent-replies / heartbeats / owner-identity (privacy) but KEEPS Reply-Tags/
  Messaging/Voice (unlike "minimal"). Telegram/owner stay on "full".
- App-only bootstrap shaping (resolveBootstrapFilesForRun → applyAppBootstrapVariants):
  excludes boilerplate (TOOLS/MEMORY/HEARTBEAT/IDENTITY/USER) and prefers lean
  <name>.app.md variants when present (AGENTS.app.md/SOUL.app.md). Originals untouched.
- Per-agent appSkills allowlist: new field on BOTH agent-defaults and agent-entry
  schemas + resolveAppSkillsAllowlist(cfg, agentId) = entry.appSkills ??
  agents.defaults.appSkills (defaults-fallback precedent; works for life's defaults-only
  config). limitAppSkills takes the caller-resolved allowlist → never global.
- Shared resolveAppPromptContext helper consumed by BOTH attempt.ts and compact.ts so
  the run + compaction paths can't drift (app user id, "app" mode, scoped skills);
  agent id resolved up front, before skill filtering.

Implements PR #77 plan (rev4). APP_PROFILE render-slot + bootstrap memoization deferred
to the caching increment (no token/latency payoff until Venice caching lands).

Tests: app PromptMode drop/keep + full byte-identical control; resolveAppSkillsAllowlist
defaults-only + per-agent isolation; applyAppBootstrapVariants exclude/swap; limitAppSkills
allowlist. tsgo + oxlint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cryptolir
cryptolir merged commit 7a071aa into main Jun 20, 2026
16 of 20 checks passed
@cryptolir
cryptolir deleted the feat/life-app-prompt-optimization branch June 20, 2026 08:38
cryptolir added a commit that referenced this pull request Jun 20, 2026
… full canonical) (#84)

Codex post-merge review of #83 (4537421648): the prior fix warned but still fell
through to result.push(file), so an app session still received the FULL
AGENTS.md/SOUL.md on a bad-variant turn — preserving the #82 privacy/slimming
regression. Now a non-ENOENT/ENOTDIR variant read failure DROPS the file for that
app session (fail-closed) instead of serving the canonical full file; warning
still surfaces the broken deploy. ENOENT/ENOTDIR (genuinely absent) still falls
back to canonical (correct for files with no variant). EISDIR test now asserts
FULL AGENTS never enters the returned files. Also fixes a latent tsgo error in
the #80 system-prompt.app-mode.test.ts (readonly as-const ownerNumbers).

Co-authored-by: Liran Peretz <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant