feat(athena): council member continuation enforcer, tool allowlist, and prompt fixes

- Add council-continuation-enforcer to nudge council members until they
  output COUNCIL_MEMBER_RESPONSE, replacing the hacky post-compaction hack
- Add background_wait + background_cancel to council member tool allowlist
  so members can properly manage their explore agents before responding
- Update COUNCIL_DELEGATION_ADDENDUM prompt to instruct members to cancel
  pending tasks and wait for explore results before final response
- Fix council_finalize path resolution to use project directory
- Remove post-compaction-continuation.ts and recentlyCompactedSessions hack
- Add council-response-checker for detecting response tag in session messages
This commit is contained in:
ismeth
2026-02-28 00:50:23 +01:00
committed by YeonGyu-Kim
parent 684b746ee7
commit 2b70130c08
14 changed files with 817 additions and 115 deletions
+2 -22
View File
@@ -1,6 +1,6 @@
import { resolve } from "node:path"
import type { PluginInput } from "@opencode-ai/plugin"
import { tool, type ToolDefinition, type ToolContext } from "@opencode-ai/plugin/tool"
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
import { runRgFiles } from "./cli"
import { resolveGrepCliWithAutoInstall } from "./constants"
import { formatGlobResult } from "./result-formatter"
@@ -23,38 +23,18 @@ export function createGlobTools(ctx: PluginInput): Record<string, ToolDefinition
"simply omit it for the default behavior. Must be a valid directory path if provided."
),
},
<<<<<<< HEAD
execute: async (args, context) => {
||||||| parent of a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
execute: async (args) => {
=======
execute: async (args, context: ToolContext) => {
>>>>>>> a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
try {
const cli = await resolveGrepCliWithAutoInstall()
<<<<<<< HEAD
<<<<<<< HEAD
const runtimeCtx = context as Record<string, unknown>
const dir = typeof runtimeCtx.directory === "string" ? runtimeCtx.directory : ctx.directory
const searchPath = args.path ? resolve(dir, args.path) : dir
||||||| parent of 804d517f (fix(tools): resolve relative paths in glob/grep against project directory)
const searchPath = args.path ?? ctx.directory
||||||| parent of a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
const searchPath = args.path ?? ctx.directory
=======
const dir = context?.directory ?? ctx.directory
const searchPath = args.path ? resolve(dir, args.path) : dir
>>>>>>> a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
const paths = [searchPath]
=======
const searchPath = args.path ? resolve(ctx.directory, args.path) : ctx.directory
const paths = [searchPath]
>>>>>>> 804d517f (fix(tools): resolve relative paths in glob/grep against project directory)
const result = await runRgFiles(
{
pattern: args.pattern,
paths: [searchPath],
paths,
},
cli
)
+1 -20
View File
@@ -1,6 +1,6 @@
import { resolve } from "node:path"
import type { PluginInput } from "@opencode-ai/plugin"
import { tool, type ToolDefinition, type ToolContext } from "@opencode-ai/plugin/tool"
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
import { runRg, runRgCount } from "./cli"
import { resolveGrepCliWithAutoInstall } from "./constants"
import { formatGrepResult, formatCountResult } from "./result-formatter"
@@ -34,31 +34,12 @@ export function createGrepTools(ctx: PluginInput): Record<string, ToolDefinition
.optional()
.describe("Limit output to first N entries. 0 or omitted means no limit."),
},
<<<<<<< HEAD
execute: async (args, context) => {
||||||| parent of a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
execute: async (args) => {
=======
execute: async (args, context: ToolContext) => {
>>>>>>> a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
try {
const globs = args.include ? [args.include] : undefined
<<<<<<< HEAD
<<<<<<< HEAD
const runtimeCtx = context as Record<string, unknown>
const dir = typeof runtimeCtx.directory === "string" ? runtimeCtx.directory : ctx.directory
const searchPath = args.path ? resolve(dir, args.path) : dir
||||||| parent of 804d517f (fix(tools): resolve relative paths in glob/grep against project directory)
const searchPath = args.path ?? ctx.directory
=======
const searchPath = args.path ? resolve(ctx.directory, args.path) : ctx.directory
>>>>>>> 804d517f (fix(tools): resolve relative paths in glob/grep against project directory)
||||||| parent of a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
const searchPath = args.path ?? ctx.directory
=======
const dir = context?.directory ?? ctx.directory
const searchPath = args.path ? resolve(dir, args.path) : dir
>>>>>>> a9d2407d (fix(tools): resolve relative paths in glob/grep against project directory)
const paths = [searchPath]
const outputMode = args.output_mode ?? "files_with_matches"
const headLimit = args.head_limit ?? 0