Skip to content

refactor: Remove docs feature - #2331

Merged
yohamta0 merged 4 commits into
mainfrom
remove-docs-feature
Jun 30, 2026
Merged

yohamta0 merged 4 commits into
mainfrom
remove-docs-feature

Conversation

@yohamta0

@yohamta0 yohamta0 commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Closes #2333

Summary:

  • Remove the docs/runbooks product surface from backend, frontend, API schema, agent tools, config, git sync, search, and SSE.
  • Remove docs and API docs routes, navigation, UI pages, hooks, tests, and unused frontend dependencies.
  • Remove repository README references to the deleted docs feature and regenerate API clients.

Testing:

  • make api
  • pnpm gen:api
  • go test ./internal/agent ./internal/cmd ./internal/cmn/config ./internal/core/exec ./internal/runtime ./internal/runtime/builtin/harness ./internal/runtime/builtin/agentstep ./internal/gitsync ./internal/persis/file ./internal/service/frontend ./internal/service/frontend/api/v1 ./internal/service/frontend/sse ./internal/tools/llmsgen -count=1
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • make bin
  • git diff --check

Summary by cubic

Remove the docs/runbooks feature across backend, frontend, API, agent tools, config, SSE, search, and git sync to simplify the product. Also remove the API Docs UI and related dependencies; purge stale references and env/context bindings; and improve enqueue concurrency test reliability.

  • Refactors

    • Deleted docs API, routes, SSE topics, search endpoints, persistence, and tests; pruned OpenAPI (api.yaml) and regenerated clients (api.gen.go, ui/src/api/v1/schema.ts).
    • Removed agent docs store and runbook_manage tool; cleaned system prompt and tool registry; updated navigate tool hints.
    • Dropped config/env/runtime bindings for docs (paths.docs_dir, DAG_DOCS_DIR, context.paths.docs_dir); removed SSE doc topic types, watchers, and endpoint mapping.
    • Updated git sync to ignore docs; tightened repo file filtering and item kind detection.
    • Simplified search UI; deleted Docs and API Docs pages/nav; removed unused UI deps (@milkdown/crepe, @milkdown/react, @scalar/api-reference-react, react-arborist).
    • Test reliability: fixed enqueue parallelism test with synchronized concurrency checks and timeouts.
  • Migration

    • Removed: /search/docs, /search/docs/matches, all /events/docs* SSE endpoints, docs tree/content routes and UI, agent runbook_manage tool.
    • Config breaking change: remove paths.docs_dir; stop using DAG_DOCS_DIR and context.paths.docs_dir in templates or scripts.
    • Git sync no longer handles docs/ items; delete or relocate any repo docs you previously synced.
    • Update any integrations using doc search, SSE, navigate-to-doc URLs, or API Docs; UI links to /docs or /api-docs no longer exist.

Written for commit 6f4781f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Search and navigation now focus on DAG-related content, with document-specific results, routes, and sidebar entries removed.
    • Updated environment and runtime paths to use artifact/DAG-oriented locations instead of document paths.
    • Simplified sync behavior so document-style items are no longer treated as a separate item type.
  • Refactor

    • Cleaned up the UI and backend by removing unused document-management screens, tabs, dialogs, and related test coverage.
    • Streamlined configuration and API definitions to match the current supported workflows.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Wait, I have range_aba609501fcf in both ui_navigation_search and readme_llmsgen. Let me fix that — it belongs to llmsgen only (it's internal/tools/llmsgen/generator.go).

I realize range_4c3da97da68a (ToolCallBadge) is in both agent_domain and ui_navigation_search. Let me fix - it belongs in ui_navigation_search only since it's a UI file. And I need to remove it from agent_domain.

Walkthrough

Removes the Docs/Runbooks feature end-to-end: deletes DocsDir config and DAG_DOCS_DIR env key, removes the DocStore interface and runbook_manage agent tool, deletes the file-backed doc store, removes all /docs HTTP API endpoints from the OpenAPI spec and Go handlers, removes SSE doc topics, and deletes the corresponding UI pages, routes, components, and navigation entries.

Changes

Docs/Runbooks Feature Removal

Layer / File(s) Summary
DocsDir config, env keys, and template bindings
internal/cmn/config/config.go, internal/cmn/config/definition.go, internal/cmn/config/loader.go, internal/cmn/config/loader_test.go, internal/core/exec/env.go, internal/core/exec/context_env.go, internal/core/exec/context_env_test.go, internal/cmn/value/template.go, internal/core/spec/builder.go
Removes DocsDir from PathsConfig/PathsDef, drops docs_dir env binding and finalizePaths fallback, removes DAG_DOCS_DIR env constant, removes context.paths.docs_dir from template/builtin-context bindings, and removes it from the DAG reserved env name set.
Agent DocStore interface and runbook_manage tool removal
internal/agent/doc.go, internal/agent/tool_registry.go, internal/agent/tool_registry_test.go, internal/agent/api.go, internal/agent/session.go, internal/agent/runbook_manage.go, internal/agent/runbook_manage_test.go, internal/agent/system_prompt.txt, internal/agent/system_prompt_test.go, internal/agent/navigate.go, internal/agent/types.go, internal/agent/session_search_test.go
Deletes internal/agent/doc.go (DocStore interface, Doc types, ValidateDocID), removes runbook_manage tool and tests, removes DocStore from ToolConfig/API/SessionManager/APIConfig, removes DocsDir from EnvironmentInfo (replaced by DAGsDir), and updates system prompt and navigate tool description.
DAGDocsDir removal from runtime exec and harness
internal/core/exec/context.go, internal/core/exec/context_test.go, internal/runtime/builtin/agentstep/executor.go, internal/runtime/builtin/harness/harness.go, internal/runtime/builtin/harness/root_container_external_test.go, internal/runtime/builtin_context_test.go, internal/runtime/env_test.go, internal/runtime/eval.go, internal/cmd/agent.go, internal/cmd/config.go, internal/cmd/config_test.go
Removes EnvKeyDAGDocsDir from managed DAG run envs and builtin context, removes DocsDir from agentstep executor system prompt env, removes DAGDocsDir from shared-container host-path filter, and updates affected tests.
File doc store and factory removal
internal/persis/file/doc/store.go, internal/persis/file/doc/store_test.go, internal/persis/file/doc/birthtime_*.go, internal/persis/file/service_stores.go, internal/service/frontend/persistence.go, internal/cmd/process/frontend_store_factories.go
Deletes the entire internal/persis/file/doc package (store implementation, tests, platform birthtime files), removes NewDocStore constructor, removes DocStoreFactory from StoreFactories, and unwires it from NewFrontendStoreFactories.
OpenAPI spec: remove docs endpoints and schemas
api/v1/api.yaml
Removes the docs tag, all /docs and /search/docs* path entries, DocResponse/DocSearchFeedResponse and related component schemas, SyncItemKind.doc enum member, and simplifies Workspace parameter description.
Frontend API v1: remove doc handlers, search, and sync wiring
internal/service/frontend/api/v1/api.go, internal/service/frontend/api/v1/docs.go, internal/service/frontend/api/v1/docs_test.go, internal/service/frontend/api/v1/search.go, internal/service/frontend/api/v1/search_test.go, internal/service/frontend/api/v1/sync.go
Removes WithDocStore/WithDocMutationNotifier/notifyDocMutation from api.go, deletes docs.go (all doc CRUD/rename/batch-delete handlers), removes SearchDocFeed/SearchDocMatches from search.go, updates sync.go to drop DAGKindDoc mapping, and cleans up all related tests.
Frontend server and SSE: doc store, doc topics, and doc file watcher
internal/service/frontend/server.go, internal/service/frontend/server_test.go, internal/service/frontend/sse/app_stream.go, internal/service/frontend/sse/types.go, internal/service/frontend/sse/topic_parse.go, internal/service/frontend/sse/multiplex_test.go
Removes docStore initialization from NewServer, drops DocStore from initAgentAPI, removes AppEventTypeDoc and handleDocEvent/docs-dir file watcher from app_stream.go, removes TopicTypeDoc/TopicTypeDocTree from SSE types, removes doc topic waking from server SSE helpers, and updates multiplex/topic-parse tests.
Git sync: remove DAGKindDoc and docs directory scanning
internal/gitsync/state.go, internal/gitsync/service.go, internal/gitsync/service_test.go
Removes DAGKindDoc constant and agentDocsDir, removes docs-prefix handling from KindForDAGID and isDocFile, removes docs-dir scanning from scanLocalDAGs, removes scanDocFiles helper, removes doc-md allowance from syncFilesToDAGsDir, and updates tests.
Frontend TypeScript schema: remove doc API types and operations
ui/src/api/v1/schema.ts
Removes /search/docs*, /docs* paths, all doc CRUD/search operations, DocResponse/DocTreeNodeResponseType and related schemas, SyncItemKind.doc enum member, PathsDocsGetParametersQuerySort, and simplifies Workspace parameter descriptions across DAG operations.
UI: remove Docs/API-docs pages, hooks, contexts, and components
ui/src/App.tsx, ui/src/__tests__/App.test.tsx, ui/src/contexts/DocTabContext.tsx, ui/src/pages/docs/..., ui/src/pages/api-docs/..., ui/src/hooks/useDocSSE.ts, ui/src/hooks/useDocTreeSSE.ts, ui/src/hooks/SSEManager.ts, ui/src/hooks/__tests__/SSEManager.test.ts, ui/src/features/agent/components/ChatInput.tsx, ui/src/features/agent/components/DocPicker.tsx, ui/src/features/agent/hooks/useDocPageContext.ts, ui/src/styles/global.css, ui/src/types/scalar-api-reference-react.d.ts, ui/package.json
Removes DocsPage and APIDocsPage routes, deletes all docs page components and DocTabContext, deletes doc library utilities, removes useDocSSE and useDocTreeSSE hooks, removes doc/doctree SSE endpoint mappings, removes DocPicker from ChatInput, and deletes ScalarViewer. Removes @milkdown/*, @scalar/api-reference-react, react-arborist npm dependencies.
UI: navigation, search, git-sync, and home page cleanup
ui/src/menu.tsx, ui/src/layouts/ContentNavigation.tsx, ui/src/pages/search/index.tsx, ui/src/pages/search/__tests__/index.test.tsx, ui/src/features/search/components/SearchResult.tsx, ui/src/features/search/components/__tests__/SearchResult.test.tsx, ui/src/pages/git-sync/index.tsx, ui/src/pages/git-sync/MoveDialog.tsx, ui/src/pages/git-sync/RowActionMenu.tsx, ui/src/pages/home/index.tsx, ui/src/pages/integrations/index.tsx, ui/src/pages/integrations/__tests__/index.test.tsx, ui/src/features/agent/components/messages/ToolCallBadge.tsx, ui/src/__tests__/menu.test.tsx
Removes Runbooks/API Reference nav items, removes /docs and /api-docs breadcrumb handling, removes doc scope from search page, simplifies SearchResult to DAG-only, removes "doc" type from git-sync filtering/counting/badge rendering, removes API Reference from home/integrations pages, and removes runbook_manage from ToolCallBadge.
README and llmsgen cleanup
README.md, internal/tools/llmsgen/generator.go
Removes inline documentation hyperlinks from README sections and the Documentation bullet block; updates llmsgen header to drop external docs URL.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • dagucloud/dagu#2112: Introduced the runbook_manage tool and DocStore wiring that this PR removes entirely.
  • dagucloud/dagu#2015: Added the Workspace query parameter and wired it into /search/docs* and /docs* endpoints that this PR deletes.
  • dagucloud/dagu#1998: Introduced EnvKeyDAGRunArtifactsDir/artifact-dir injection into buildDAGRunBuiltinContext, which this PR now uses to populate context.paths.artifacts_dir in place of context.paths.docs_dir.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description has summary, issue, and testing, but it misses the template's explicit Changes and Checklist sections. Add a Changes section with per-line bullets and a Checklist section with the required checkbox items.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: removing the docs feature surface.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-docs-feature

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
internal/tools/llmsgen/generator.go (1)

42-47: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Regenerate llms.txt to match the new header
The committed llms.txt still has the old docs URL and is missing It summarizes repository-local workflow references. Run make llms so the checked-in artifact stays in sync.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/tools/llmsgen/generator.go` around lines 42 - 47, The llms.txt
generator header has changed, but the committed llms.txt is still stale and
missing the new sentence, so regenerate the artifact to keep it in sync. Update
the checked-in llms.txt by running the llms generation flow driven by
generator.go so the new header text from the generator is reflected exactly in
the repo.
internal/service/frontend/api/v1/sync.go (1)

701-729: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Don’t coerce stale sync kinds into DAG items.

With doc removed from SyncItemKind, stale persisted doc states now fall through as dag and get a .yaml path. Filter unsupported kinds instead of misrepresenting them in /sync/status.

Proposed fix
-func toAPISyncItemKind(itemID string, kind gitsync.DAGKind) api.SyncItemKind {
+func toAPISyncItemKind(itemID string, kind gitsync.DAGKind) (api.SyncItemKind, bool) {
 	kind = resolveKind(itemID, kind)
 
 	switch kind {
 	case gitsync.DAGKindMemory:
-		return api.SyncItemKindMemory
+		return api.SyncItemKindMemory, true
 	case gitsync.DAGKindSkill:
-		return api.SyncItemKindSkill
+		return api.SyncItemKindSkill, true
 	case gitsync.DAGKindSoul:
-		return api.SyncItemKindSoul
+		return api.SyncItemKindSoul, true
 	case gitsync.DAGKindConfig:
-		return api.SyncItemKindConfig
+		return api.SyncItemKindConfig, true
 	case gitsync.DAGKindDAG:
-		return api.SyncItemKindDag
+		return api.SyncItemKindDag, true
 	default:
-		return api.SyncItemKindDag
+		return "", false
 	}
 }
 
-func syncItemFilePath(itemID string, kind gitsync.DAGKind) string {
+func syncItemFilePath(itemID string, kind gitsync.DAGKind) (string, bool) {
 	kind = resolveKind(itemID, kind)
 	ext := ".yaml"
 	switch kind {
 	case gitsync.DAGKindMemory, gitsync.DAGKindSkill, gitsync.DAGKindSoul:
 		ext = ".md"
 	case gitsync.DAGKindDAG, gitsync.DAGKindConfig:
 		// default .yaml extension
+	default:
+		return "", false
 	}
-	return itemID + ext
+	return itemID + ext, true
 }
-		filePath := syncItemFilePath(itemID, state.Kind)
+		filePath, ok := syncItemFilePath(itemID, state.Kind)
+		if !ok {
+			continue
+		}
+		itemKind, ok := toAPISyncItemKind(itemID, state.Kind)
+		if !ok {
+			continue
+		}
 		item := api.SyncItem{
@@
-			Kind:               toAPISyncItemKind(itemID, state.Kind),
+			Kind:               itemKind,

Also applies to: 742-748

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/service/frontend/api/v1/sync.go` around lines 701 - 729, The sync
kind mapping in toAPISyncItemKind and syncItemFilePath is coercing unsupported
stale kinds into DAG, which misrepresents removed doc states in /sync/status.
Update resolveKind handling so unsupported kinds are filtered out or treated as
invalid instead of falling through to gitsync.DAGKindDAG, and make both
toAPISyncItemKind and syncItemFilePath return a non-DAG/empty result for stale
kinds rather than assigning a .yaml path. Use the existing resolveKind,
toAPISyncItemKind, and syncItemFilePath symbols to keep the behavior consistent
for supported gitsync.DAGKind values only.
ui/src/pages/git-sync/RowActionMenu.tsx (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the GPL v3 source header.

This TSX source file starts directly with imports, so it is missing the required license header. As per coding guidelines, “Add GPL v3 license headers to source files.”

Proposed fix
+// Copyright (C) 2026 Yota Hamada
+// SPDX-License-Identifier: GPL-3.0-or-later
+
 import { SyncStatus } from '`@/api/v1/schema`';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/src/pages/git-sync/RowActionMenu.tsx` at line 1, The RowActionMenu TSX
file is missing the required GPL v3 source header at the top of the module.
Update the file so the license header appears before the existing imports,
following the same GPL v3 source header format used in other source files. Keep
the rest of the RowActionMenu component and its SyncStatus import unchanged.

Source: Coding guidelines

ui/src/pages/git-sync/index.tsx (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the GPL v3 source header.

This TSX source file starts directly with imports, so it is missing the required license header. As per coding guidelines, “Add GPL v3 license headers to source files.”

Proposed fix
+// Copyright (C) 2026 Yota Hamada
+// SPDX-License-Identifier: GPL-3.0-or-later
+
 import {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/src/pages/git-sync/index.tsx` at line 1, The TSX module is missing the
required GPL v3 source header at the top of the file. Add the standard GPL v3
license comment block before the existing import section in this page component
so the file begins with the header and then the current imports and page logic.

Source: Coding guidelines

internal/gitsync/service.go (1)

257-267: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Filter unsupported .md entries out of repoFileSet as well.

Right now legacy docs/*.md files are skipped for syncing, but they were already added to repoFileSet a few lines earlier. That means reconcileAfterPull still sees them as “present in remote”, so pre-removal docs state can linger indefinitely after an upgrade instead of being forgotten.

Suggested fix
-	// Build set of DAG IDs present in remote repo for reconcileAfterPull
-	repoFileSet := make(map[string]struct{}, len(files))
-	for _, file := range files {
-		repoFileSet[s.filePathToDAGID(file)] = struct{}{}
-	}
+	// Build set of supported DAG IDs present in remote repo for reconcileAfterPull
+	repoFileSet := make(map[string]struct{}, len(files))
 
 	for _, file := range files {
 		dagID := s.filePathToDAGID(file)
 
 		// Only allow .md files from memory/, skills/, or souls/ directories.
 		if filepath.Ext(file) == ".md" && !isMemoryFile(dagID) && !isSkillFile(dagID) && !isSoulFile(dagID) {
 			continue
 		}
+		repoFileSet[dagID] = struct{}{}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/gitsync/service.go` around lines 257 - 267, The unsupported `.md`
entries are still being added to repoFileSet before the sync filter runs, so
legacy docs can remain marked as present. Update the file handling in service.go
around the repoFileSet build and the subsequent file loop so the same .md
allowlist used in the loop (memory/, skills/, souls/) is applied when populating
repoFileSet, and keep reconcileAfterPull from seeing skipped docs as
remote-present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/agent/system_prompt.txt`:
- Around line 10-13: The system prompt text incorrectly refers to nonexistent
“memory tool” and “skill tool” actions, which can mislead the agent. Update the
wording in the prompt to match the available mechanisms, using the actual memory
and skill interfaces exposed elsewhere in the agent flow (for example the
file-backed memory read/patch path and skill discovery via search_skills and
delegate.skills). Keep the guidance about what belongs in memory vs skills, but
replace the unsupported tool names with the real symbols so the prompt stays
accurate.

In `@ui/src/features/search/components/SearchResult.tsx`:
- Around line 189-207: The SearchResult loadMore callback currently only reads
response.error, so a thrown client/network failure from client.GET can escape
instead of producing a LoadMoreResponse error. Update the loadMore async
function in SearchResult to wrap the request in try/catch, keep the existing
response.data mapping on success, and return a LoadMoreResponse with an error
string in the catch path so failures are always surfaced consistently.

---

Outside diff comments:
In `@internal/gitsync/service.go`:
- Around line 257-267: The unsupported `.md` entries are still being added to
repoFileSet before the sync filter runs, so legacy docs can remain marked as
present. Update the file handling in service.go around the repoFileSet build and
the subsequent file loop so the same .md allowlist used in the loop (memory/,
skills/, souls/) is applied when populating repoFileSet, and keep
reconcileAfterPull from seeing skipped docs as remote-present.

In `@internal/service/frontend/api/v1/sync.go`:
- Around line 701-729: The sync kind mapping in toAPISyncItemKind and
syncItemFilePath is coercing unsupported stale kinds into DAG, which
misrepresents removed doc states in /sync/status. Update resolveKind handling so
unsupported kinds are filtered out or treated as invalid instead of falling
through to gitsync.DAGKindDAG, and make both toAPISyncItemKind and
syncItemFilePath return a non-DAG/empty result for stale kinds rather than
assigning a .yaml path. Use the existing resolveKind, toAPISyncItemKind, and
syncItemFilePath symbols to keep the behavior consistent for supported
gitsync.DAGKind values only.

In `@internal/tools/llmsgen/generator.go`:
- Around line 42-47: The llms.txt generator header has changed, but the
committed llms.txt is still stale and missing the new sentence, so regenerate
the artifact to keep it in sync. Update the checked-in llms.txt by running the
llms generation flow driven by generator.go so the new header text from the
generator is reflected exactly in the repo.

In `@ui/src/pages/git-sync/index.tsx`:
- Line 1: The TSX module is missing the required GPL v3 source header at the top
of the file. Add the standard GPL v3 license comment block before the existing
import section in this page component so the file begins with the header and
then the current imports and page logic.

In `@ui/src/pages/git-sync/RowActionMenu.tsx`:
- Line 1: The RowActionMenu TSX file is missing the required GPL v3 source
header at the top of the module. Update the file so the license header appears
before the existing imports, following the same GPL v3 source header format used
in other source files. Keep the rest of the RowActionMenu component and its
SyncStatus import unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e240ceb2-09b8-4086-a91e-f30b0355a324

📥 Commits

Reviewing files that changed from the base of the PR and between 3ef01dd and 9ce349b.

⛔ Files ignored due to path filters (2)
  • assets/images/readme-documents-dark.png is excluded by !**/*.png
  • ui/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (109)
  • README.md
  • api/v1/api.gen.go
  • api/v1/api.yaml
  • internal/agent/api.go
  • internal/agent/doc.go
  • internal/agent/navigate.go
  • internal/agent/runbook_manage.go
  • internal/agent/runbook_manage_test.go
  • internal/agent/session.go
  • internal/agent/session_search_test.go
  • internal/agent/system_prompt.txt
  • internal/agent/system_prompt_test.go
  • internal/agent/tool_registry.go
  • internal/agent/tool_registry_test.go
  • internal/agent/types.go
  • internal/cmd/agent.go
  • internal/cmd/config.go
  • internal/cmd/config_test.go
  • internal/cmd/process/frontend_store_factories.go
  • internal/cmn/config/config.go
  • internal/cmn/config/definition.go
  • internal/cmn/config/loader.go
  • internal/cmn/config/loader_test.go
  • internal/cmn/value/template.go
  • internal/core/exec/context.go
  • internal/core/exec/context_env.go
  • internal/core/exec/context_env_test.go
  • internal/core/exec/context_test.go
  • internal/core/exec/env.go
  • internal/core/spec/builder.go
  • internal/gitsync/service.go
  • internal/gitsync/service_test.go
  • internal/gitsync/state.go
  • internal/persis/file/doc/birthtime_darwin.go
  • internal/persis/file/doc/birthtime_linux.go
  • internal/persis/file/doc/birthtime_other.go
  • internal/persis/file/doc/store.go
  • internal/persis/file/doc/store_test.go
  • internal/persis/file/service_stores.go
  • internal/runtime/builtin/agentstep/executor.go
  • internal/runtime/builtin/harness/harness.go
  • internal/runtime/builtin/harness/root_container_external_test.go
  • internal/runtime/builtin_context_test.go
  • internal/runtime/env_test.go
  • internal/runtime/eval.go
  • internal/service/frontend/api/v1/api.go
  • internal/service/frontend/api/v1/docs.go
  • internal/service/frontend/api/v1/docs_test.go
  • internal/service/frontend/api/v1/search.go
  • internal/service/frontend/api/v1/search_test.go
  • internal/service/frontend/api/v1/sync.go
  • internal/service/frontend/persistence.go
  • internal/service/frontend/server.go
  • internal/service/frontend/server_test.go
  • internal/service/frontend/sse/app_stream.go
  • internal/service/frontend/sse/multiplex_test.go
  • internal/service/frontend/sse/topic_parse.go
  • internal/service/frontend/sse/types.go
  • internal/tools/llmsgen/generator.go
  • ui/package.json
  • ui/src/App.tsx
  • ui/src/__tests__/App.test.tsx
  • ui/src/__tests__/menu.test.tsx
  • ui/src/api/v1/schema.ts
  • ui/src/contexts/DocTabContext.tsx
  • ui/src/features/agent/components/ChatInput.tsx
  • ui/src/features/agent/components/DocPicker.tsx
  • ui/src/features/agent/components/__tests__/ChatMessages.test.tsx
  • ui/src/features/agent/components/__tests__/WorkspaceScopedPickers.test.tsx
  • ui/src/features/agent/components/messages/ToolCallBadge.tsx
  • ui/src/features/agent/hooks/useDocPageContext.ts
  • ui/src/features/search/components/SearchResult.tsx
  • ui/src/features/search/components/__tests__/SearchResult.test.tsx
  • ui/src/hooks/SSEManager.ts
  • ui/src/hooks/__tests__/SSEManager.test.ts
  • ui/src/hooks/useDocSSE.ts
  • ui/src/hooks/useDocTreeSSE.ts
  • ui/src/layouts/ContentNavigation.tsx
  • ui/src/menu.tsx
  • ui/src/pages/__tests__/DocArboristNode.test.tsx
  • ui/src/pages/api-docs/ScalarViewer.tsx
  • ui/src/pages/api-docs/__tests__/index.test.tsx
  • ui/src/pages/api-docs/index.tsx
  • ui/src/pages/docs/components/CreateDocModal.tsx
  • ui/src/pages/docs/components/DocArboristNode.tsx
  • ui/src/pages/docs/components/DocEditor.tsx
  • ui/src/pages/docs/components/DocExternalChangeDialog.tsx
  • ui/src/pages/docs/components/DocOutlinePanel.tsx
  • ui/src/pages/docs/components/DocTabBar.tsx
  • ui/src/pages/docs/components/DocTabEditorPanel.tsx
  • ui/src/pages/docs/components/DocTreeSidebar.tsx
  • ui/src/pages/docs/components/RenameDocModal.tsx
  • ui/src/pages/docs/index.tsx
  • ui/src/pages/docs/lib/__tests__/doc-mutation.test.ts
  • ui/src/pages/docs/lib/__tests__/doc-url.test.ts
  • ui/src/pages/docs/lib/__tests__/doc-validation.test.ts
  • ui/src/pages/docs/lib/doc-mutation.ts
  • ui/src/pages/docs/lib/doc-url.ts
  • ui/src/pages/docs/lib/doc-validation.ts
  • ui/src/pages/git-sync/MoveDialog.tsx
  • ui/src/pages/git-sync/RowActionMenu.tsx
  • ui/src/pages/git-sync/index.tsx
  • ui/src/pages/home/index.tsx
  • ui/src/pages/integrations/__tests__/index.test.tsx
  • ui/src/pages/integrations/index.tsx
  • ui/src/pages/search/__tests__/index.test.tsx
  • ui/src/pages/search/index.tsx
  • ui/src/styles/global.css
  • ui/src/types/scalar-api-reference-react.d.ts
💤 Files with no reviewable changes (79)
  • ui/src/features/agent/components/tests/WorkspaceScopedPickers.test.tsx
  • ui/src/pages/docs/lib/doc-url.ts
  • ui/src/pages/integrations/index.tsx
  • ui/src/pages/docs/lib/tests/doc-url.test.ts
  • ui/src/pages/docs/lib/tests/doc-validation.test.ts
  • internal/persis/file/doc/store.go
  • internal/agent/types.go
  • ui/src/hooks/useDocTreeSSE.ts
  • ui/src/pages/integrations/tests/index.test.tsx
  • ui/src/pages/docs/lib/tests/doc-mutation.test.ts
  • ui/src/hooks/useDocSSE.ts
  • internal/cmd/config_test.go
  • internal/persis/file/doc/birthtime_darwin.go
  • ui/src/pages/docs/components/CreateDocModal.tsx
  • ui/src/types/scalar-api-reference-react.d.ts
  • internal/cmd/config.go
  • ui/src/pages/docs/index.tsx
  • internal/core/exec/context.go
  • internal/persis/file/doc/birthtime_other.go
  • internal/cmn/config/definition.go
  • ui/src/pages/docs/components/DocTreeSidebar.tsx
  • ui/src/pages/docs/components/DocTabBar.tsx
  • ui/src/contexts/DocTabContext.tsx
  • ui/src/pages/api-docs/tests/index.test.tsx
  • ui/src/features/agent/components/DocPicker.tsx
  • ui/src/features/agent/components/messages/ToolCallBadge.tsx
  • ui/src/pages/docs/lib/doc-validation.ts
  • internal/runtime/builtin/harness/harness.go
  • ui/src/features/agent/hooks/useDocPageContext.ts
  • ui/src/pages/tests/DocArboristNode.test.tsx
  • internal/cmn/config/config.go
  • internal/core/exec/context_env.go
  • internal/core/spec/builder.go
  • ui/src/pages/docs/components/DocExternalChangeDialog.tsx
  • ui/src/pages/docs/components/RenameDocModal.tsx
  • internal/cmn/config/loader.go
  • ui/src/hooks/SSEManager.ts
  • internal/cmd/agent.go
  • ui/src/pages/api-docs/ScalarViewer.tsx
  • ui/src/pages/api-docs/index.tsx
  • ui/src/pages/docs/components/DocOutlinePanel.tsx
  • ui/src/pages/docs/components/DocTabEditorPanel.tsx
  • internal/agent/tool_registry.go
  • internal/runtime/eval.go
  • internal/agent/navigate.go
  • ui/src/pages/docs/components/DocArboristNode.tsx
  • ui/src/features/search/components/tests/SearchResult.test.tsx
  • ui/src/pages/docs/lib/doc-mutation.ts
  • ui/src/tests/menu.test.tsx
  • internal/cmn/value/template.go
  • internal/agent/runbook_manage.go
  • ui/src/pages/docs/components/DocEditor.tsx
  • internal/agent/tool_registry_test.go
  • internal/cmd/process/frontend_store_factories.go
  • internal/runtime/builtin/agentstep/executor.go
  • internal/cmn/config/loader_test.go
  • internal/service/frontend/persistence.go
  • internal/gitsync/state.go
  • ui/src/styles/global.css
  • internal/persis/file/service_stores.go
  • internal/service/frontend/sse/app_stream.go
  • ui/package.json
  • internal/persis/file/doc/birthtime_linux.go
  • ui/src/tests/App.test.tsx
  • internal/agent/doc.go
  • internal/service/frontend/server_test.go
  • internal/service/frontend/sse/types.go
  • ui/src/hooks/tests/SSEManager.test.ts
  • ui/src/App.tsx
  • internal/core/exec/env.go
  • internal/service/frontend/api/v1/docs.go
  • internal/agent/system_prompt_test.go
  • internal/service/frontend/api/v1/docs_test.go
  • internal/persis/file/doc/store_test.go
  • internal/agent/session.go
  • internal/agent/runbook_manage_test.go
  • internal/agent/api.go
  • internal/service/frontend/api/v1/api.go
  • internal/service/frontend/api/v1/search.go

Comment thread internal/agent/system_prompt.txt Outdated
Comment on lines +10 to +13
You have persistent memory across sessions. Save durable facts using the memory tool: user preferences, environment details, tool quirks, and stable conventions. Memory is injected into every turn, so keep it compact and focused on facts that will still matter later.
Prioritize what reduces future user steering — the most valuable memory is one that prevents the user from having to correct or remind you again. User preferences and recurring corrections matter more than procedural task details.
Do NOT save task progress, session outcomes, completed-work logs, or temporary TODO state to memory; use session_search to recall those from past transcripts. If you've discovered a new way to do something, solved a problem that could be necessary later, save it as a skill with the skill tool.
Write memories as declarative facts, not instructions to yourself. 'User prefers concise responses' ✓ — 'Always respond concisely' ✗. 'Project uses pytest with xdist' ✓ — 'Run tests with pytest -n 4' ✗. Imperative phrasing gets re-read as a directive in later sessions and can cause repeated work or override the user's current request. Procedures and workflows belong in workflow definitions, not memory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search prompt for tool references =="
rg -n -C2 '\b(memory tool|skill tool|search_skills|session_search|read|patch)\b' \
  internal/agent/system_prompt.txt

echo
echo "== Search agent files for tool registration / action injection =="
rg -n -C3 '\b(memory|skill|search_skills|Actions|system_prompt)\b' \
  internal/agent/tool_registry.go \
  internal/agent/api.go \
  internal/agent/session.go \
  internal/agent/navigate.go \
  internal/agent/system_prompt_test.go

Repository: dagucloud/dagu

Length of output: 21782


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate system prompt generator and action wiring =="
git ls-files 'internal/agent/*' | sed -n '1,200p'

echo
echo "== Outline likely prompt files =="
for f in internal/agent/system_prompt.go internal/agent/system_prompt_test.go internal/agent/session.go internal/agent/api.go; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    ast-grep outline "$f" --view expanded || true
    echo
  fi
done

echo
echo "== Search for memory/skill action definitions across repo =="
rg -n -C3 '\b(memory|skill|search_skills|session_search|Actions|GenerateSystemPrompt|<tools>|tool(s)?\b)' internal . \
  --glob '!**/vendor/**'

Repository: dagucloud/dagu

Length of output: 50371


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== system prompt generator =="
f=internal/agent/system_prompt.go
[ -f "$f" ] && sed -n '1,260p' "$f"

echo
echo "== tool/action definitions mentioning memory or skills =="
rg -n -C2 '\b(memory tool|skill tool|search_skills|session_search|memory store|LoadGlobalMemory|LoadDAGMemory|save memory|skill)\b' internal/agent \
  --glob '!**/*_test.go'

echo
echo "== where .Actions is injected into the prompt =="
rg -n -C3 '\{\{\.Actions\}\}|\bActions\b' internal/agent \
  --glob '!**/*_test.go'

Repository: dagucloud/dagu

Length of output: 20656


Replace the nonexistent memory/skill tool references
internal/agent/system_prompt.txt:10-13 tells the agent to use a memory tool and a skill tool, but the actual tool set only exposes file-backed memory handling (read/patch) and skill discovery via search_skills and delegate.skills. Update the prompt to use those names so it doesn’t point the model at unavailable actions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/agent/system_prompt.txt` around lines 10 - 13, The system prompt
text incorrectly refers to nonexistent “memory tool” and “skill tool” actions,
which can mislead the agent. Update the wording in the prompt to match the
available mechanisms, using the actual memory and skill interfaces exposed
elsewhere in the agent flow (for example the file-backed memory read/patch path
and skill discovery via search_skills and delegate.skills). Keep the guidance
about what belongs in memory vs skills, but replace the unsupported tool names
with the real symbols so the prompt stays accurate.

Comment on lines +189 to +207
loadMore: async (cursor?: string): Promise<LoadMoreResponse> => {
const response = await client.GET('/search/dags/{fileName}/matches', {
params: {
path: { fileName: result.fileName },
query: {
remoteNode,
q: query,
cursor,
...dagWorkspaceQuery,
},
};
},
});

return {
error: response.error?.message || undefined,
matches: response.data?.matches ?? [],
hasMore: response.data?.hasMore ?? false,
nextCursor: response.data?.nextCursor,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle thrown request failures in loadMore.

response.error covers API-level failures, but a thrown network/client error would currently escape the callback instead of returning a LoadMoreResponse error state. As per coding guidelines, “Use error handling with try/catch for async operations.”

Proposed fix
       loadMore: async (cursor?: string): Promise<LoadMoreResponse> => {
-        const response = await client.GET('/search/dags/{fileName}/matches', {
-          params: {
-            path: { fileName: result.fileName },
-            query: {
-              remoteNode,
-              q: query,
-              cursor,
-              ...dagWorkspaceQuery,
+        try {
+          const response = await client.GET('/search/dags/{fileName}/matches', {
+            params: {
+              path: { fileName: result.fileName },
+              query: {
+                remoteNode,
+                q: query,
+                cursor,
+                ...dagWorkspaceQuery,
+              },
             },
-          },
-        });
+          });
 
-        return {
-          error: response.error?.message || undefined,
-          matches: response.data?.matches ?? [],
-          hasMore: response.data?.hasMore ?? false,
-          nextCursor: response.data?.nextCursor,
-        };
+          return {
+            error: response.error?.message || undefined,
+            matches: response.data?.matches ?? [],
+            hasMore: response.data?.hasMore ?? false,
+            nextCursor: response.data?.nextCursor,
+          };
+        } catch (error) {
+          return {
+            error:
+              error instanceof Error
+                ? error.message
+                : 'Failed to load more matches',
+            matches: [],
+            hasMore: false,
+          };
+        }
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
loadMore: async (cursor?: string): Promise<LoadMoreResponse> => {
const response = await client.GET('/search/dags/{fileName}/matches', {
params: {
path: { fileName: result.fileName },
query: {
remoteNode,
q: query,
cursor,
...dagWorkspaceQuery,
},
};
},
});
return {
error: response.error?.message || undefined,
matches: response.data?.matches ?? [],
hasMore: response.data?.hasMore ?? false,
nextCursor: response.data?.nextCursor,
};
loadMore: async (cursor?: string): Promise<LoadMoreResponse> => {
try {
const response = await client.GET('/search/dags/{fileName}/matches', {
params: {
path: { fileName: result.fileName },
query: {
remoteNode,
q: query,
cursor,
...dagWorkspaceQuery,
},
},
});
return {
error: response.error?.message || undefined,
matches: response.data?.matches ?? [],
hasMore: response.data?.hasMore ?? false,
nextCursor: response.data?.nextCursor,
};
} catch (error) {
return {
error:
error instanceof Error
? error.message
: 'Failed to load more matches',
matches: [],
hasMore: false,
};
}
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/src/features/search/components/SearchResult.tsx` around lines 189 - 207,
The SearchResult loadMore callback currently only reads response.error, so a
thrown client/network failure from client.GET can escape instead of producing a
LoadMoreResponse error. Update the loadMore async function in SearchResult to
wrap the request in try/catch, keep the existing response.data mapping on
success, and return a LoadMoreResponse with an error string in the catch path so
failures are always surfaced consistently.

Source: Coding guidelines

@yohamta0 yohamta0 changed the title Remove docs feature refactor: Remove docs feature Jun 30, 2026
@yohamta0
yohamta0 merged commit 51c097a into main Jun 30, 2026
14 checks passed
@yohamta0
yohamta0 deleted the remove-docs-feature branch June 30, 2026 03:19
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.

Remove built-in Docs feature

1 participant