Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

  • Log router decisions (action, reason, decision_method, latency, tokens) to unified thread messages
  • Add config versioning to track rule/router configuration changes over time
  • Link messages to config versions for feedback analysis by configuration

Changes

  • router.ts: Added ExecutionPlanBase type with metadata fields (decision_method, latency_ms, tokens_input, tokens_output, model)
  • thread-service.ts: Added router_decision and config_version_id fields to message interfaces
  • bolt-app.ts: Added buildRouterDecision() helper, updated handleChannelMessage() to log router decisions
  • config-version.ts: NEW config versioning service for tracking rule/router config versions
  • claude-client.ts: Updated to track and return config_version_id
  • addie-chat.ts: Updated to include config_version_id in web chat messages
  • migrations: Added 068 (router_decision column) and 069 (config_versions table)

Test plan

  • Verified config versions created correctly (version_id=1 with 29 rules)
  • Verified messages store config_version_id
  • Verified feedback submission updates config version stats
  • Verified analysis view shows approval rate and last usage time
  • Typecheck passes
  • All tests pass

🤖 Generated with Claude Code

bokelley and others added 8 commits December 31, 2025 18:30
- Add ExecutionPlanBase type with metadata fields (decision_method, latency, tokens)
- Log router decisions to unified thread messages (action, reason, timing)
- Create config versioning system to track rule/router configuration changes
- Link messages to config versions for feedback analysis by configuration
- Add database migrations for router_decision column and config_versions table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Allows testing the Haiku router decision logic without Slack credentials:
- POST /api/admin/addie/test-router with { message, source?, isThread? }
- Returns router decision metadata (action, reason, method, latency, tokens, model, tools)
- Logs to database with router_decision field for verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Router improvements:
- Add TOOL_DESCRIPTIONS to router prompt so it picks tools based on query
  intent (not just keywords). Distinguishes "how does X work?" (search_docs)
  from "validate my X" (validate_adagents)
- Add separate expertise area for validation/debugging requests

Docs indexing:
- Extract markdown headings as separate searchable artifacts
- Generate anchor links for deep linking to specific sections
- Skip headings inside code blocks to avoid false matches
- Build headings index alongside docs index (1659 headings from 100 docs)

Search tracking:
- Add migration 070 for addie_search_logs table
- Log all search queries for pattern analysis
- Track results count, latency, and tool used
- Add analytics functions for content gap detection

Code review fixes:
- Use logger.warn instead of logger.debug for search logging failures
- Truncate queries to 1000 chars to prevent storage bloat
- Handle code blocks when extracting headings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Router improvements:
- Add usage_hints field to AddieTool interface for router-specific guidance
- Router now builds tool descriptions from tool definitions (no duplication)
- Distinguish "how does X work?" (search_docs) from "validate my X" (validate_adagents)

Prompt improvements:
- Strengthen GitHub issue drafting instructions - users cannot see tool outputs
- Add conversation context maintenance guidance to prevent entity substitution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Previously, each message in a Slack DM thread was processed without
context from previous turns. Claude only received the current message
plus member context, causing it to lose track of conversation topics
(e.g., confusing Ebiquity with Scope3 when asked follow-up questions).

Changes:
- Fetch conversation history from database before processing DM messages
- Pass previous user/assistant messages to Claude via threadContext param
- Limit to last 10 messages to avoid token bloat
- Log when conversation history is loaded for debugging

Also strengthened prompt instructions:
- Clarify that tool outputs are invisible to users (GitHub issue bug)
- Add guidance to maintain entity focus throughout conversations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Main branch already has migrations 068-071, so renumber our new migrations:
- 068 -> 072: router_decision_metadata
- 069 -> 073: config_versioning
- 070 -> 074: addie_search_logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Main had two migrations with version 070:
- 070_org_admin_group_dm.sql (from PR #447)
- 070_fix_knowledge_source_url_constraint.sql (from PR #448)

Renumber to fix:
- 070 stays: org_admin_group_dm (first merged)
- 070 -> 071: fix_knowledge_source_url_constraint (second merged)
- 071 -> 072: join_request_names
- 072 -> 073: router_decision_metadata
- 073 -> 074: config_versioning
- 074 -> 075: addie_search_logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@gitguardian
Copy link

gitguardian bot commented Jan 1, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
24028510 Triggered Generic CLI Secret 6e196bb scripts/migrate-csv-via-api.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

bokelley and others added 3 commits January 1, 2026 12:42
- Add 30-min cache for member insights with invalidation on writes
- Prefetch insights when user opens Addie (before first message)
- Add 30-min cache for active insight goals (invalidated on admin changes)
- Add 30-min cache for Slack channel info
- Add 30-min cache for admin status checks
- Parallelize member context and insights fetching
- Router now uses member insights for smarter tool selection
- Renumber migrations after PR #449 merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Restore 074_notification_channels.sql from main and renumber branch migrations:
- 074 → 075 join_request_names
- 075 → 076 router_decision_metadata
- 076 → 077 config_versioning
- 077 → 078 addie_search_logs

Also fix 071 → 070 fix_knowledge_source_url_constraint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[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.

2 participants