hashgraph / hashgraph/hedera-agent-kit-js

NextJS example Issue in Human In The Loop Mode

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
67
Forks
78
PR merge metrics
No merged PRs in 30d

Description

### Bug Report: Wallet Connection Issue in Human In The Loop Mode

**Description**
When running the Next.js example in **Human In The Loop** mode, the app sometimes encounters issues after the first startup and wallet connection.

After connecting the Hashpack wallet (via both WalletConnect modal and Hashpack browser plugin), the app displayed a horizontal line instead of the expected account ID. Additionally, attempting to write to the agent resulted in errors.

Refreshing the page resolved the issue.

I was unable to reproduce this issue consistently after the initial occurrence.

---

**Environment Variables**
```env
NEXT_PUBLIC_WC_PROJECT_ID=8...
NEXT_PUBLIC_NETWORK=testnet
NEXT_PUBLIC_AGENT_MODE=human
AI_PROVIDER=openai
HEDERA_OPERATOR_ID=0.0.5...
HEDERA_OPERATOR_KEY=0x.... # ecdsa
OPENAI_API_KEY="sk-proj-..."
````

> Note:
> In `NEXT_PUBLIC_AGENT_MODE=human`, the `HEDERA_OPERATOR_ID` and `HEDERA_OPERATOR_KEY` are technically not required, but this was the configuration in which the issue was encountered.

---

**Steps to Reproduce**

1. Start the app for the first time.
2. Connect the Hashpack wallet using WalletConnect or the Hashpack browser plugin.
3. Observe that the account ID is not displayed (horizontal line shown instead).
4. Attempt to write to the agent → errors occur.
5. Refresh the page → issue is resolved.

---

**Expected Behavior**

* Account ID should display correctly after connecting the wallet.
* Writing to the agent should work without requiring a page refresh.

**Actual Behavior**

* Account ID not displayed (horizontal line instead).
* Errors when writing to the agent.
* Refresh required to fix the issue.

---

**Status**

* Intermittent issue.
* Could not reproduce consistently.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.