Skip to content

feat(web): copy agent resume commands#1060

Open
techotaku39 wants to merge 1 commit into
tiann:mainfrom
techotaku39:feat/web-copy-agent-session-id
Open

feat(web): copy agent resume commands#1060
techotaku39 wants to merge 1 commit into
tiann:mainfrom
techotaku39:feat/web-copy-agent-session-id

Conversation

@techotaku39

@techotaku39 techotaku39 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a Copy resume command action to both session action menus: the active session header and the session-list context menu.

The copied text is a directly runnable, agent-native command rather than a HAPI URL or bare session ID, for example:

codex resume 019f68ed-6462-7ea2-b717-964f14615f64

Motivation

HAPI already stores each coding agent's native conversation ID, but retrieving it currently requires exporting the conversation as JSON and locating an agent-specific metadata field such as codexSessionId or claudeSessionId.

Copying a ready-to-run command makes it easier to continue the same conversation directly in the corresponding local CLI while keeping the agent identity unambiguous.

Changes

  • Add Copy resume command to both session action-menu entry points.
  • Resolve the native session ID from full session metadata in the session header.
  • Reuse the flattened agentSessionId from session summaries in the session list.
  • Resolve summary IDs by current agent flavor, avoiding stale IDs left by another integration and including Pi sessions.
  • Hide the action when the flavor is unknown, retired (Gemini), the matching native ID is missing, or no command can be generated.
  • Reject native IDs outside a conservative shell-safe character set instead of interpolating arbitrary metadata into executable commands.
  • Generate the command syntax used by each supported integration:
Agent Copied command
Claude claude --resume <id>
Codex codex resume <id>
OpenCode opencode -s <id>
Grok grok --resume <id>
Cursor agent resume <id>
Kimi kimi --session <id>
Pi pi --session-id <id>
  • Add English and Simplified Chinese labels and clipboard-result feedback.
  • Add focused coverage for command generation, menu visibility/callback behavior, unsafe IDs, retired Gemini sessions, stale mixed-agent metadata, Pi summaries, and copying from the session-list menu.

This is intentionally separate from a broader effort to make every action in the header and session-list menus identical. Unlike #951, this action copies an agent-native resume command rather than a cross-session HAPI reference.

Testing

  • bun typecheck
  • bun run test:web
  • bun test shared/src/sessionSummary.test.ts
  • bun run --cwd web test src/lib/agentSessionId.test.ts src/components/SessionList.directory-action.test.tsx src/components/SessionActionMenu.test.tsx
  • git diff --check

AI disclosure

Implementation and tests were produced with OpenAI Codex (GPT-5.6).

@github-actions github-actions 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.

Findings

  • [Major] Gemini resume commands are offered even though the CLI deliberately rejects Gemini resume. web/src/lib/agentSessionId.ts:43 builds gemini --resume <id>, but the command registry keeps gemini as a tombstone and hapi resume throws before handoff for Gemini sessions. This makes the new action appear for sessions where the copied command cannot work.
    Suggested fix:

const RESUME_COMMAND_BY_FLAVOR = {
claude: (id: string) => claude --resume ${quoteResumeId(id)},
codex: (id: string) => codex resume ${quoteResumeId(id)},
opencode: (id: string) => opencode -s ${quoteResumeId(id)},
grok: (id: string) => grok --resume ${quoteResumeId(id)},
cursor: (id: string) => agent resume ${quoteResumeId(id)},
kimi: (id: string) => kimi --resume ${quoteResumeId(id)},
pi: (id: string) => pi --session-id ${quoteResumeId(id)}
} as const satisfies Partial<Record<keyof typeof SESSION_ID_FIELD_BY_FLAVOR, (id: string) => string>>


- [Major] Native session IDs are interpolated into shell commands without quoting or validation. Metadata schemas accept arbitrary strings for these ids, so an imported or agent-supplied id containing shell metacharacters would be copied as executable syntax rather than a single argument. Evidence: `web/src/lib/agentSessionId.ts:73`.
  Suggested fix:
  ```ts
function quoteResumeId(id: string): string {
    return `'${id.replaceAll("'", "'\\''")}'`
}

return RESUME_COMMAND_BY_FLAVOR[normalizedFlavor as keyof typeof RESUME_COMMAND_BY_FLAVOR](normalizedSessionId)
  • [Major] The session-list menu can copy the wrong native id for the current flavor. The new row action trusts the flattened agentSessionId (web/src/components/SessionList.tsx:655), but toSessionSummary currently picks ids by fixed field order (codexSessionId before cursorSessionId/kimiSessionId) and does not include piSessionId. A session with flavor: 'cursor' plus stale codexSessionId will copy agent resume <codex-id>, while Pi rows never get the advertised action.
    Suggested fix:

function getSummaryAgentSessionId(metadata: Metadata): string | undefined {
const flavor = metadata.flavor?.trim().toLowerCase()
if (flavor === 'codex') return metadata.codexSessionId
if (flavor === 'claude') return metadata.claudeSessionId
if (flavor === 'gemini') return metadata.geminiSessionId
if (flavor === 'opencode') return metadata.opencodeSessionId
if (flavor === 'grok') return metadata.grokSessionId
if (flavor === 'cursor') return metadata.cursorSessionId
if (flavor === 'kimi') return metadata.kimiSessionId
if (flavor === 'pi') return metadata.piSessionId
return metadata.codexSessionId
?? metadata.claudeSessionId
?? metadata.geminiSessionId
?? metadata.opencodeSessionId
?? metadata.grokSessionId
?? metadata.cursorSessionId
?? metadata.kimiSessionId
?? metadata.piSessionId
?? undefined
}


**Summary**
- Review mode: initial
- The main risks are incorrect/unusable copied commands and unsafe command construction. The new focused tests cover happy paths, but they miss Gemini unsupported behavior, shell metacharacters in ids, stale mixed-id summaries, and Pi session-list coverage.

**Testing**
- Not run: `bun` is not installed in this runner (`bun: command not found`).

*HAPI Bot*

Comment thread web/src/lib/agentSessionId.ts Outdated
const RESUME_COMMAND_BY_FLAVOR = {
claude: (id: string) => `claude --resume ${id}`,
codex: (id: string) => `codex resume ${id}`,
gemini: (id: string) => `gemini --resume ${id}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] This exposes a copy action for Gemini sessions even though this repo explicitly tombstones Gemini local launch/resume: cli/src/commands/registry.ts:24 registers gemini as unsupported and cli/src/commands/resume.ts:221 rejects Gemini before handoff. A copied gemini --resume <id> will fail for exactly the sessions where the action appears.

Suggested fix:

const RESUME_COMMAND_BY_FLAVOR = {
    claude: (id: string) => `claude --resume ${quoteResumeId(id)}`,
    codex: (id: string) => `codex resume ${quoteResumeId(id)}`,
    opencode: (id: string) => `opencode -s ${quoteResumeId(id)}`,
    grok: (id: string) => `grok --resume ${quoteResumeId(id)}`,
    cursor: (id: string) => `agent resume ${quoteResumeId(id)}`,
    kimi: (id: string) => `kimi --resume ${quoteResumeId(id)}`,
    pi: (id: string) => `pi --session-id ${quoteResumeId(id)}`
} as const satisfies Partial<Record<keyof typeof SESSION_ID_FIELD_BY_FLAVOR, (id: string) => string>>

Also change the Gemini command-generation test to expect null.

return null
}

return RESUME_COMMAND_BY_FLAVOR[normalizedFlavor as keyof typeof RESUME_COMMAND_BY_FLAVOR](normalizedSessionId)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] The session id is copied into a shell command as raw text. Since the metadata schema only requires these fields to be strings, an imported/agent-supplied id with shell metacharacters is copied as extra shell syntax instead of one argv value.

Suggested fix:

function quoteResumeId(id: string): string {
    return `'${id.replaceAll("'", "'\\''")}'`
}

return RESUME_COMMAND_BY_FLAVOR[normalizedFlavor as keyof typeof RESUME_COMMAND_BY_FLAVOR](normalizedSessionId)

Then make each command builder use quoteResumeId(id) and add a regression test with an id containing spaces/quotes/semicolons.

})

const sessionName = getSessionTitle(s)
const resumeCommand = getResumeCommand(s.metadata?.flavor, s.metadata?.agentSessionId)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] This row action trusts the flattened summary agentSessionId for the current flavor, but summaries are not flavor-aware today: shared/src/sessionSummary.ts:118 picks codexSessionId before later flavor ids and omits piSessionId. That means a Cursor/Kimi/Pi row with stale/missing flattened data can copy the wrong command or hide the advertised Pi action, while the header path uses full metadata and gets the matching field.

Suggested fix:

function getSummaryAgentSessionId(metadata: Metadata): string | undefined {
    const flavor = metadata.flavor?.trim().toLowerCase()
    if (flavor === 'codex') return metadata.codexSessionId
    if (flavor === 'claude') return metadata.claudeSessionId
    if (flavor === 'gemini') return metadata.geminiSessionId
    if (flavor === 'opencode') return metadata.opencodeSessionId
    if (flavor === 'grok') return metadata.grokSessionId
    if (flavor === 'cursor') return metadata.cursorSessionId
    if (flavor === 'kimi') return metadata.kimiSessionId
    if (flavor === 'pi') return metadata.piSessionId
    return metadata.codexSessionId
        ?? metadata.claudeSessionId
        ?? metadata.geminiSessionId
        ?? metadata.opencodeSessionId
        ?? metadata.grokSessionId
        ?? metadata.cursorSessionId
        ?? metadata.kimiSessionId
        ?? metadata.piSessionId
        ?? undefined
}

Use that in toSessionSummary and add tests for stale mixed ids plus Pi.

@techotaku39

techotaku39 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all three review findings in 28c93f9:

  • removed resume-command generation for retired Gemini sessions
  • reject native session IDs outside a conservative shell-safe character set before command interpolation
  • resolve flattened summary IDs by current flavor and include Pi IDs, with stale mixed-agent coverage

Added focused tests for Gemini, unsafe IDs, stale Cursor/Codex metadata, and Pi summaries. bun typecheck, the full web suite, focused web tests, and shared session-summary tests pass.

@github-actions github-actions 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.

Findings

  • [Major] Kimi resume command uses the wrong native flag. The new command table copies kimi --resume <id>, but the repo's Kimi launcher resumes native Kimi sessions with --session (cli/src/kimi/kimiLocal.ts:15), and --resume is not found in the repo docs/source for Kimi. This makes the new menu action copy an unusable command for Kimi sessions. Evidence: web/src/lib/agentSessionId.ts:46.
    Suggested fix:
    const RESUME_COMMAND_BY_FLAVOR = {
        claude: (id: string) => `claude --resume ${id}`,
        codex: (id: string) => `codex resume ${id}`,
        opencode: (id: string) => `opencode -s ${id}`,
        grok: (id: string) => `grok --resume ${id}`,
        cursor: (id: string) => `agent resume ${id}`,
        kimi: (id: string) => `kimi --session ${id}`,
        pi: (id: string) => `pi --session-id ${id}`
    } as const satisfies Partial<Record<keyof typeof SESSION_ID_FIELD_BY_FLAVOR, (id: string) => string>>

Questions

  • None.

Summary

  • Review mode: follow-up after new commits
  • The previous bot findings around Gemini, unsafe IDs, and stale summary IDs appear addressed. Remaining issue: Kimi copies a command that does not match the repo's own native Kimi resume flag.

Testing

  • Not run (review only; did not execute PR code). Existing new test should update the Kimi expectation to kimi --session kimi-id.

HAPI Bot

Comment thread web/src/lib/agentSessionId.ts Outdated
opencode: (id: string) => `opencode -s ${id}`,
grok: (id: string) => `grok --resume ${id}`,
cursor: (id: string) => `agent resume ${id}`,
kimi: (id: string) => `kimi --resume ${id}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] This copies kimi --resume <id>, but the repo's native Kimi launcher resumes sessions with --session (cli/src/kimi/kimiLocal.ts:15), and --resume is not found in the repo docs/source for Kimi. The new action will therefore copy an unusable command for Kimi sessions.

Suggested fix:

kimi: (id: string) => `kimi --session ${id}`,

Also update the Kimi expectation in web/src/lib/agentSessionId.test.ts to kimi --session kimi-id.

@techotaku39
techotaku39 force-pushed the feat/web-copy-agent-session-id branch from 28c93f9 to bef718b Compare July 17, 2026 11:06
@techotaku39

Copy link
Copy Markdown
Contributor Author

Addressed the Kimi follow-up in bef718b: the copied command now uses kimi --session <id>, matching cli/src/kimi/kimiLocal.ts. Updated the focused command-generation test and PR description. bun typecheck, the focused Vitest suite, and git diff --check pass.

@github-actions github-actions 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.

Findings

  • [Major] Session-list copy can use a stale cross-agent ID — getSummaryAgentSessionId still falls back to another agent's stored ID after a known flavor's matching field is missing. The session list then has only flavor + agentSessionId, so a pi/cursor/etc. session with only a stale codexSessionId will copy a command like pi --session-id stale-codex or agent resume stale-codex. This conflicts with the existing resume path, which ignores cross-flavor IDs (web/src/lib/sessionResume.ts:4, hub/src/sync/syncEngine.ts:835). Evidence: shared/src/sessionSummary.ts:131, consumed at web/src/components/SessionList.tsx:655.
    Suggested fix:
    if (flavorField) {
        const flavorSessionId = metadata[flavorField]
        return typeof flavorSessionId === 'string' && flavorSessionId.trim()
            ? flavorSessionId.trim()
            : undefined
    }
    
    // Only use legacy fallback when flavor is unknown or missing.

Questions

  • None.

Summary

  • Review mode: follow-up after new commits
  • Previous Kimi command issue is resolved. Remaining issue: the session-list copy path can still generate a wrong native command when summary metadata flattens a stale ID from a different flavor.

Testing

  • Not run (review only; did not execute PR code). Add coverage for a known-flavor summary with only a stale cross-flavor ID and assert the copy action is hidden.

HAPI Bot

}
}

return metadata.codexSessionId

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MAJOR] This fallback still returns an ID from another agent after the current known flavor's matching field is missing. The session-list action later receives only flavor + agentSessionId, so a pi/cursor/etc. row with a stale codexSessionId can copy a command for the current flavor using the wrong native ID. Existing resume handling explicitly ignores cross-flavor IDs (web/src/lib/sessionResume.ts:4, hub/src/sync/syncEngine.ts:835), so the flattened summary should do the same for known flavors.

Suggested fix:

if (flavorField) {
    const flavorSessionId = metadata[flavorField]
    return typeof flavorSessionId === 'string' && flavorSessionId.trim()
        ? flavorSessionId.trim()
        : undefined
}

// Only fall back when the flavor is unknown or missing.

Also add a test where flavor: 'pi' or flavor: 'cursor' has only codexSessionId; agentSessionId should be absent and the row menu should hide the copy action.

@techotaku39
techotaku39 force-pushed the feat/web-copy-agent-session-id branch from bef718b to db0774c Compare July 18, 2026 00:42
@techotaku39

Copy link
Copy Markdown
Contributor Author

Addressed the stale cross-agent fallback in db0774c. Known flavors now return only their matching native session ID; if that field is missing, the summary leaves agentSessionId undefined so the session-list copy action stays hidden. Legacy fixed-order fallback remains only for missing or unknown flavors. Added a Pi-with-stale-Codex-ID regression test. bun test shared/src/sessionSummary.test.ts, bun typecheck, and git diff --check pass.

@github-actions github-actions 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.

Findings

  • [Minor] Session-list copy failures are silent — the new row-menu handler catches and drops safeCopyToClipboard errors, so when clipboard access is unavailable the menu closes and the user gets no indication that nothing was copied. The header copy path already shows success/error toasts, but the list path suppresses the same failure at web/src/components/SessionList.tsx:755.
    Suggested fix:
    const toast = useToast()
    
    const handleCopyResumeCommand = async () => {
        if (!resumeCommand) return
    
        try {
            await safeCopyToClipboard(resumeCommand)
            toast.addToast({
                title: t('session.copyResumeCommand.toast.success.title'),
                body: t('session.copyResumeCommand.toast.success.body'),
                sessionId: s.id,
                url: `/sessions/${s.id}`
            })
        } catch {
            toast.addToast({
                title: t('session.copyResumeCommand.toast.error.title'),
                body: t('session.copyResumeCommand.toast.error.body'),
                sessionId: s.id,
                url: `/sessions/${s.id}`
            })
        }
    }

Summary

  • Review mode: follow-up after new commits
  • Prior stale cross-agent summary issue is addressed. Remaining issue: the session-list entry point can fail its only operation without feedback.

Testing

  • Not run (automation; did not execute PR code). Add a row-menu test where navigator.clipboard.writeText rejects and assert an error toast is shown.

HAPI Bot

Comment thread web/src/components/SessionList.tsx Outdated
sessionActive={s.active}
onRename={() => setRenameOpen(true)}
onCopyResumeCommand={resumeCommand
? () => { void safeCopyToClipboard(resumeCommand).catch(() => {}) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MINOR] This row-menu copy handler drops clipboard failures, so if safeCopyToClipboard throws the menu closes and the user gets no indication that nothing was copied. The header entry point already reports success/error toasts; the list entry point should do the same.

Suggested fix:

const toast = useToast()

const handleCopyResumeCommand = async () => {
    if (!resumeCommand) return

    try {
        await safeCopyToClipboard(resumeCommand)
        toast.addToast({
            title: t('session.copyResumeCommand.toast.success.title'),
            body: t('session.copyResumeCommand.toast.success.body'),
            sessionId: s.id,
            url: `/sessions/${s.id}`
        })
    } catch {
        toast.addToast({
            title: t('session.copyResumeCommand.toast.error.title'),
            body: t('session.copyResumeCommand.toast.error.body'),
            sessionId: s.id,
            url: `/sessions/${s.id}`
        })
    }
}

@techotaku39
techotaku39 force-pushed the feat/web-copy-agent-session-id branch from db0774c to f7b9afb Compare July 18, 2026 01:30
@techotaku39

Copy link
Copy Markdown
Contributor Author

Addressed the silent session-list clipboard failure in f7b9afb. The row action now mirrors the header path with success and error toasts. Added coverage for both successful copy feedback and a rejected Clipboard API plus failed fallback. bun run --cwd web test src/components/SessionList.directory-action.test.tsx, bun typecheck, and git diff --check pass.

@github-actions github-actions 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.

Findings
None.

Summary

  • Review mode: follow-up after new commits
  • No issues found in the latest diff. The prior clipboard-failure feedback issue is addressed; remaining risk is limited to tests not being run in this review pass.

Testing

  • Not run (automation; did not execute PR code).

HAPI Bot

@tiann

tiann commented Jul 18, 2026

Copy link
Copy Markdown
Owner

We already support hapi resume, and extending this utility is preferable to this approach.

@techotaku39

techotaku39 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

We already support hapi resume, and extending this utility is preferable to this approach.

@tiann 感谢您的回复和说明。我认同 Agent 的恢复逻辑应该统一放在 hapi resume 中,而不是由 Web 端分别维护。

不过,我的真实需求并不是单纯恢复旧会话,而是“跨会话引用”:

  • 当前 Agent 正在会话 A 中工作;
  • 会话 B 中包含当前任务需要的历史上下文;
  • 我希望从会话 B 复制一个命令或引用,粘贴到会话 A;
  • 让会话 A 中的 Agent 读取会话 B 的历史内容后,继续当前任务。

目前我使用类似下面的内容来告诉 Agent 如何定位旧会话:

codex resume <codex-session-id>

目的主要是读取历史,而不是接管或交互式恢复会话 B。

想确认一下,您希望这里改为复制:

hapi resume <hapi-session-id>

还是希望扩展 HAPI,提供类似 hapi session show <id>hapi resume <id> --print 的非交互、只读查看方式?

如果现有的 hapi resume 已经可以安全覆盖这个场景,也麻烦您告知推荐用法。谢谢!


Thank you for the clarification. I agree that agent resume logic should be centralized in hapi resume instead of being maintained separately in the Web UI.

However, my actual use case is not simply resuming an old session. It is cross-session referencing:

  • The current agent is working in session A.
  • Session B contains history or implementation context needed by the current task.
  • I want to copy a command or reference for session B and paste it into session A.
  • The agent in session A can then inspect session B's history before continuing its current task.

At the moment, I give the agent something like:

codex resume <codex-session-id>

The main goal is to locate and read the previous transcript, rather than hand off to or interactively resume session B.

Would you prefer this action to copy:

hapi resume <hapi-session-id>

Or would it be better to extend HAPI with a non-interactive, read-only command such as hapi session show <id> or hapi resume <id> --print?

If the existing hapi resume command already supports this workflow safely, please let me know the recommended usage. I will adjust the PR accordingly. Thank you!

@tiann

tiann commented Jul 18, 2026

Copy link
Copy Markdown
Owner

如果你的需求是告诉agent 如何读取历史,最直接的方式是直接给 path,因为 resume 并不是给 agent 用的,它也并不会执行什么东西,对它有用的就是那个 sessionid。但是可能有个问题,有的 agent 用的 sqlite?
如果这样的话,你需要的是 hapi export id 直接导出历史记录给它看,而不是让 agent 自己根据 id 去找文件在哪。

@techotaku39

Copy link
Copy Markdown
Contributor Author

如果这样的话,你需要的是 hapi export id 直接导出历史记录给它看,而不是让 agent 自己根据 id 去找文件在哪。

@tiann 感谢说明,我理解您的意思了:会话历史应该由 HAPI 统一读取和转换,而不是让 Agent 根据原生 Session ID 自己寻找 Claude、Codex 或 SQLite 等不同存储位置。

重新考虑后,我也觉得下面这个新方案比当前 #1060 的“复制 Agent 恢复命令”更符合实际需求。如果这个方向可行,我认为 #1060 就没有继续保留的必要,可以关闭并改为单独讨论或实现新方案。

我的实际场景是在会话 A 中引用会话 B,让当前 Agent 读取会话 B 的历史后继续当前任务。相比手动执行导出命令,我更希望在 HAPI Web 中直接完成:

  1. 在对话输入框旁增加“引用会话”按钮;
  2. 点击后展开历史会话列表,并支持搜索;
  3. 选择会话 B 后,在输入框中显示一个会话引用;
  4. 发送后,当前 Agent 通过 HAPI 的统一能力按需读取会话 B 的历史;
  5. 整个过程不恢复、不接管会话 B,也不生成需要用户清理的本地文件。

大致交互是:

Web 选择历史会话
    → 消息中附带 HAPI Session 引用
    → 当前 Agent 通过 HAPI 读取该会话历史

底层是否可以复用现有的 Session Export/Message Service,再提供一个类似 hapi__read_session 的 MCP 工具?Web 只传递 HAPI Session ID、标题等引用信息,Agent 需要时再调用工具读取有限数量或相关范围的历史,而不是把整个会话一次性塞进当前上下文。

如果 MCP 工具不是合适的实现方式,也可以由 Hub 在发送消息时解析结构化会话引用并提供历史内容。我的核心需求是:

  • 移动端可以方便地选择历史会话;
  • 不需要手动查找或复制 Session ID;
  • 不生成临时导出文件;
  • 不改变被引用会话的状态;
  • 由 HAPI 统一处理不同 Agent 的历史存储;
  • 避免一次性把完整历史塞入上下文。

您觉得这种“交互式引用会话”的方向是否符合 HAPI 的设计?如果认可,我可以关闭 #1060,再根据您建议的底层方式整理一个独立 Issue 或更小范围的 PR。谢谢!

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